diff mpeg12.c @ 1311:fc858abf6b10 libavcodec

fixed segfault if sequence header has not been found before slice decoding
author bellard
date Mon, 16 Jun 2003 14:09:18 +0000
parents 57172377849a
children e9da5a651eab
line wrap: on
line diff
--- a/mpeg12.c	Mon Jun 16 13:19:30 2003 +0000
+++ b/mpeg12.c	Mon Jun 16 14:09:18 2003 +0000
@@ -1990,6 +1990,9 @@
     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 */