]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/huffyuvdec.c
avdevice/iec61883: free the private context at the end
[ffmpeg] / libavcodec / huffyuvdec.c
index 979c4b9d5c11a198c8697c1f99c5a10c10d7db32..66357bfb40353f6f762c4c6ce2a1c19a859b84ec 100644 (file)
@@ -919,6 +919,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     AVFrame *const p = data;
     int table_size = 0, ret;
 
+    if (buf_size < (width * height + 7)/8)
+        return AVERROR_INVALIDDATA;
+
     av_fast_padded_malloc(&s->bitstream_buffer,
                    &s->bitstream_buffer_size,
                    buf_size);