Skip to content

Commit

Permalink
avcodec/vc1dec: do not crash when flushing without an allocated frame
Browse files Browse the repository at this point in the history
Fixes Ticket3837
Found-by: Piotr Bandurski <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 6801eb0)

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Aug 11, 2014
1 parent c5129da commit a1fe3b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/vc1dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 (i = 0; i < v->sprite_height>>!!plane; i++)
memset(f->data[plane] + i * f->linesize[plane],
Expand Down

0 comments on commit a1fe3b4

Please sign in to comment.