[FFmpeg-cvslog] flashsv: check for keyframe before using differential coding

Janne Grunau git at videolan.org
Thu Jan 17 02:31:00 CET 2013


ffmpeg | branch: release/0.10 | Janne Grunau <janne-libav at jannau.net> | Sat Nov 24 15:50:03 2012 +0100| [522e97bd9e91903249b5b7f9fb9f267bb55cb967] | committer: Reinhard Tartler

flashsv: check for keyframe before using differential coding

Fixes a segfault in te fuzzed sample resolutionchange.flv_s211713.

CC: libav-stable at libav.org
(cherry picked from commit 5ae72f54532960cb9eae82a1c9e8d505106c022b)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=522e97bd9e91903249b5b7f9fb9f267bb55cb967
---

 libavcodec/flashsv.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index c99c21c..792ad57 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,



More information about the ffmpeg-cvslog mailing list