[FFmpeg-cvslog] lavc/midivid: check return value of init_get_bits8()
Zhong Li
git at videolan.org
Mon Dec 23 21:15:50 EET 2019
ffmpeg | branch: master | Zhong Li <zhongli_dev at 126.com> | Mon Dec 23 14:14:09 2019 +0000| [5dc527f9cad2912069dcc9dc6c05bcf9bf05eb87] | committer: Paul B Mahol
lavc/midivid: check return value of init_get_bits8()
Fix CID 1456088
Signed-off-by: Zhong Li <zhongli_dev at 126.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5dc527f9cad2912069dcc9dc6c05bcf9bf05eb87
---
libavcodec/midivid.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c
index 38465c5fbc..bb5105bd57 100644
--- a/libavcodec/midivid.c
+++ b/libavcodec/midivid.c
@@ -63,7 +63,7 @@ static int decode_mvdv(MidiVidContext *s, AVCodecContext *avctx, AVFrame *frame)
if (intra_flag) {
nb_blocks = (avctx->width / 2) * (avctx->height / 2);
} else {
- int skip_linesize;
+ int ret, skip_linesize;
nb_blocks = bytestream2_get_le32(gb);
skip_linesize = avctx->width >> 1;
@@ -73,7 +73,9 @@ static int decode_mvdv(MidiVidContext *s, AVCodecContext *avctx, AVFrame *frame)
if (bytestream2_get_bytes_left(gb) < mask_size)
return AVERROR_INVALIDDATA;
- init_get_bits8(&mask, mask_start, mask_size);
+ ret = init_get_bits8(&mask, mask_start, mask_size);
+ if (ret < 0)
+ return ret;
bytestream2_skip(gb, mask_size);
skip = s->skip;
More information about the ffmpeg-cvslog
mailing list