[FFmpeg-cvslog] avcodec/fic: Check if a frame is available before using it

Michael Niedermayer git at videolan.org
Fri Aug 22 02:46:39 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 14 05:32:44 2014 +0200| [1b5ec6a0c3309e7a051751b2f989ffa068516d93] | committer: Michael Niedermayer

avcodec/fic: Check if a frame is available before using it

Fixes null pointer dereference
Fixes: ficvf.avi
Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/fic.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index d08d240..5615e69 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -282,8 +282,13 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
         av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
 
     /* Is it a skip frame? */
-    if (src[17])
+    if (src[17]) {
+        if (!ctx->final_frame) {
+            av_log(avctx, AV_LOG_WARNING, "Initial frame is skipped\n");
+            return AVERROR_INVALIDDATA;
+        }
         goto skip;
+    }
 
     nslices = src[13];
     if (!nslices) {



More information about the ffmpeg-cvslog mailing list