[FFmpeg-cvslog] flashv: check if keyframe is available, fix null deref.

Michael Niedermayer git at videolan.org
Tue Nov 13 01:41:21 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov 13 00:21:59 2012 +0100| [e9cb533fbb90c274cfed07b69ebf5c1989573e20] | committer: Michael Niedermayer

flashv: check if keyframe is available, fix null deref.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 643dab3..14c514c 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -406,6 +406,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
                 int k;
                 int off = (s->image_height - y_pos - 1) * s->frame.linesize[0];
 
+                if (!s->keyframe) {
+                    av_log(avctx, AV_LOG_ERROR, "no keyframe yet\n");
+                    return AVERROR_INVALIDDATA;
+                }
                 for (k = 0; k < cur_blk_height; k++)
                     memcpy(s->frame.data[0] + off - k*s->frame.linesize[0] + x_pos*3,
                            s->keyframe + off - k*s->frame.linesize[0] + x_pos*3,



More information about the ffmpeg-cvslog mailing list