hwcontext_vaapi: Fix mapping from DRM
authorMark Thompson <sw@jkqxz.net>
Thu, 24 May 2018 00:17:12 +0000 (01:17 +0100)
committerMark Thompson <sw@jkqxz.net>
Thu, 24 May 2018 00:20:31 +0000 (01:20 +0100)
This was broken by bed670a1de29b58fcb3fe046562d8bd125b1457f, which added
an assert that always failed.

libavutil/hwcontext_vaapi.c

index e55bb8d..a2387d4 100644 (file)
@@ -1024,8 +1024,10 @@ static int vaapi_map_from_drm(AVHWFramesContext *src_fc, AVFrame *dst,
            "%08x.\n", desc->objects[0].fd, va_fourcc);
 
     for (i = 0; i < FF_ARRAY_ELEMS(vaapi_format_map); i++) {
-        if (vaapi_format_map[i].fourcc == va_fourcc)
+        if (vaapi_format_map[i].fourcc == va_fourcc) {
             va_rt_format = vaapi_format_map[i].rt_format;
+            break;
+        }
     }
 
     av_assert0(i < FF_ARRAY_ELEMS(vaapi_format_map));