Skip to content

Commit

Permalink
flashsv: check for keyframe before using differential coding
Browse files Browse the repository at this point in the history
Fixes a segfault in te fuzzed sample resolutionchange.flv_s211713.

CC: libav-stable@libav.org
  • Loading branch information
Janne Grunau committed Nov 26, 2012
1 parent 706acb5 commit 5ae72f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavcodec/flashsv.c
Expand Up @@ -377,6 +377,11 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
}

if (has_diff) {
if (!s->keyframe) {
av_log(avctx, AV_LOG_ERROR,
"inter frame without keyframe\n");
return AVERROR_INVALIDDATA;
}
s->diff_start = get_bits(&gb, 8);
s->diff_height = get_bits(&gb, 8);
av_log(avctx, AV_LOG_DEBUG,
Expand Down

0 comments on commit 5ae72f5

Please sign in to comment.