summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavcodec/zerocodec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c
index 02e37bc..4944a3e 100644
--- a/libavcodec/zerocodec.c
+++ b/libavcodec/zerocodec.c
@@ -65,6 +65,10 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
pic->key_frame = 1;
pic->pict_type = AV_PICTURE_TYPE_I;
} else {
+ if (prev == NULL) {
+ av_log(avctx, AV_LOG_ERROR, "No previous frame!\n");
+ return AVERROR_INVALIDDATA;
+ }
pic->key_frame = 0;
pic->pict_type = AV_PICTURE_TYPE_P;
}
OpenPOWER on IntegriCloud