1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/interplayvideo: Check that enough data is available for opcode_0x9

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fd5185b45df_5895_interplay-logo-2MB.mve
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-19 00:17:12 +01:00
parent ff1e30c059
commit 66875798eb

View File

@ -308,6 +308,11 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
int x, y;
unsigned char P[4];
if (bytestream2_get_bytes_left(&s->stream_ptr) < 8) {
av_log(s->avctx, AV_LOG_ERROR, "too little data for opcode 0x9\n");
return AVERROR_INVALIDDATA;
}
/* 4-color encoding */
bytestream2_get_buffer(&s->stream_ptr, P, 4);