]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/jvdec.c
lavc: support extracting audio service type from side data
[ffmpeg] / libavcodec / jvdec.c
index bb347e045a70a6b207c4567849d08c4680af26c5..2a7aa102548e8909050bc22a32130e663637e947 100644 (file)
@@ -43,6 +43,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
 {
     JvContext *s = avctx->priv_data;
 
+    if (!avctx->width || !avctx->height ||
+        (avctx->width & 7) || (avctx->height & 7)) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
+               avctx->width, avctx->height);
+        return AVERROR(EINVAL);
+    }
+
     s->frame = av_frame_alloc();
     if (!s->frame)
         return AVERROR(ENOMEM);