diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-11-24 15:50:03 +0100 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-11-26 10:26:01 +0100 |
commit | 5ae72f54532960cb9eae82a1c9e8d505106c022b (patch) | |
tree | f80e9233e70789460225a74ecc128a7b5361b529 | |
parent | 706acb558a38eba633056773280155d66c2f4b24 (diff) | |
download | ffmpeg-5ae72f54532960cb9eae82a1c9e8d505106c022b.tar.gz |
flashsv: check for keyframe before using differential coding
Fixes a segfault in te fuzzed sample resolutionchange.flv_s211713.
CC: libav-stable@libav.org
-rw-r--r-- | libavcodec/flashsv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 2ba32641b7..ac57f9f68a 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -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, |