overflow fix
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 8 May 2005 09:58:41 +0000 (09:58 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 8 May 2005 09:58:41 +0000 (09:58 +0000)
Originally committed as revision 4201 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegvideo.c

index 4857dcb..4aaee76 100644 (file)
@@ -5378,7 +5378,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
         for(i=1;i<64;i++){
             int j= s->dsp.idct_permutation[i];
 
-            s->intra_matrix[j] = clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3);
+            s->intra_matrix[j] = clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3) & 0xFF;
         }
         convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16, 
                        s->intra_matrix, s->intra_quant_bias, 8, 8, 1);