diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-11-24 15:50:03 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-01-12 17:59:39 +0100 |
commit | 522e97bd9e91903249b5b7f9fb9f267bb55cb967 (patch) | |
tree | 9fde5f53914d344b5a9bfd66cbe8b67e0420239c | |
parent | d282e5ce7286eab3bc4f5cbfe81a74551bd31006 (diff) | |
download | ffmpeg-522e97bd9e91903249b5b7f9fb9f267bb55cb967.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
(cherry picked from commit 5ae72f54532960cb9eae82a1c9e8d505106c022b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-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 c99c21c719..792ad57f88 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -370,6 +370,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, |