aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-06-16 14:09:18 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-06-16 14:09:18 +0000
commit855127bc920ea7f626c8ab22654a83d510732469 (patch)
tree85bc838d7411052c8ccb2dd8bf7f51026fa1b945
parent63efe9a7e6467895e2aac21418949247e4cc511d (diff)
downloadffmpeg-855127bc920ea7f626c8ab22654a83d510732469.tar.gz
fixed segfault if sequence header has not been found before slice decoding
Originally committed as revision 1964 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mpeg12.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index c31a711c7c..c68f8d8a05 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1990,6 +1990,9 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
+ if (!s1->mpeg_enc_ctx_allocated)
+ return 0;
+
/* end of slice reached */
if (/*s->mb_y<<field_pic == s->mb_height &&*/ !s->first_field) {
/* end of image */