Ignore first entry of intra matrixes if it is invalid.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 1 May 2009 12:31:19 +0000 (12:31 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 1 May 2009 12:31:19 +0000 (12:31 +0000)
Fixes pink.mpg / issue1046.

Originally committed as revision 18724 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpeg12.c

index d5635b1..019dc81 100644 (file)
@@ -1480,6 +1480,10 @@ static int load_matrix(MpegEncContext *s, uint16_t matrix0[64], uint16_t matrix1
             av_log(s->avctx, AV_LOG_ERROR, "matrix damaged\n");
             return -1;
         }
+        if(intra && i==0 && v!=8){
+            av_log(s->avctx, AV_LOG_ERROR, "intra matrix invalid, ignoring\n");
+            v= 8; // needed by pink.mpg / issue1046
+        }
         matrix0[j] = v;
         if(matrix1)
             matrix1[j] = v;