1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avcodec/vc1dec: do not crash when flushing without an allocated frame

Fixes Ticket3837
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-08-11 02:16:43 +02:00
parent f4e814f787
commit 6801eb0a09

View File

@@ -5514,7 +5514,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
Since we can't enforce it, clear to black the missing sprite. This is Since we can't enforce it, clear to black the missing sprite. This is
wrong but it looks better than doing nothing. */ wrong but it looks better than doing nothing. */
if (f->data[0]) if (f && f->data[0])
for (plane = 0; plane < (s->flags&CODEC_FLAG_GRAY ? 1 : 3); plane++) for (plane = 0; plane < (s->flags&CODEC_FLAG_GRAY ? 1 : 3); plane++)
for (i = 0; i < v->sprite_height>>!!plane; i++) for (i = 0; i < v->sprite_height>>!!plane; i++)
memset(f->data[plane] + i * f->linesize[plane], memset(f->data[plane] + i * f->linesize[plane],