[libav-commits] flashsv: check for keyframe before using differential coding

Janne Grunau git at libav.org
Sat Jan 12 18:38:54 CET 2013


Module: libav
Branch: release/0.8
Commit: 522e97bd9e91903249b5b7f9fb9f267bb55cb967

Author:    Janne Grunau <janne-libav at jannau.net>
Committer: Reinhard Tartler <siretart at tauware.de>
Date:      Sat Nov 24 15:50:03 2012 +0100

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>

---

 libavcodec/flashsv.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

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 libav-commits mailing list