]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cuviddec.c
lavc/allcodecs: Add mpeg4 omx encoder, missed in 0e387232
[ffmpeg] / libavcodec / cuviddec.c
index d59d1faf9ed9b6129b46c89c71a9b48f9bdc0cdb..acee78cf2cb74b8c93e01ea01c1936dc8b045eff 100644 (file)
@@ -805,6 +805,12 @@ static int cuvid_test_capabilities(AVCodecContext *avctx,
         return AVERROR(EINVAL);
     }
 
+    if ((probed_width * probed_height) / 256 > caps->nMaxMBCount) {
+        av_log(avctx, AV_LOG_ERROR, "Video macroblock count %d exceeds maximum of %d\n",
+               (int)(probed_width * probed_height) / 256, caps->nMaxMBCount);
+        return AVERROR(EINVAL);
+    }
+
     return 0;
 }