summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-14 05:32:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-22 02:22:31 +0200
commit1b5ec6a0c3309e7a051751b2f989ffa068516d93 (patch)
treea46ace7fa1f3228610c545de4d558a330f2c3bb4
parentfccd85b9f30525f88692f53134eba41f1f2d90db (diff)
avcodec/fic: Check if a frame is available before using it
Fixes null pointer dereference Fixes: ficvf.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/fic.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index d08d240efe..5615e69abc 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) {