summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-05-04 10:24:39 +0000
committerPaul B Mahol <onemda@gmail.com>2012-05-04 10:42:11 +0000
commit4b70bba57ec9d61282e8b2b427d738dd44415652 (patch)
treeda4ad0982407c69566bad18a76253fa10ca4c80b /libavcodec
parentb7159877b18f6f0262180574cb7163ca6ab664c6 (diff)
zerocodec: check if there is previous frame
Fixes crash in bug #1219. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/zerocodec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c
index 02e37bc0e7..4944a3e486 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;
}