]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/bmp.c
Merge commit '85ad5ea72ce3983947a3b07e4b35c66cb16dfaba'
[ffmpeg] / libavcodec / bmp.c
index 72957499d339e3361efec57164ad36dd3d3490a4..65d239e4f8d8d72d3649bca2630f33b7b2797ca9 100644 (file)
@@ -133,8 +133,11 @@ static int bmp_decode_frame(AVCodecContext *avctx,
         alpha = bytestream_get_le32(&buf);
     }
 
-    avctx->width  = width;
-    avctx->height = height > 0 ? height : -(unsigned)height;
+    ret = ff_set_dimensions(avctx, width, height > 0 ? height : -(unsigned)height);
+    if (ret < 0) {
+        av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions %d %d\n", width, height);
+        return AVERROR_INVALIDDATA;
+    }
 
     avctx->pix_fmt = AV_PIX_FMT_NONE;