mpeg12enc: Correctly mask dimensions
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Jan 2013 14:31:58 +0000 (15:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Jan 2013 14:47:06 +0000 (15:47 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpeg12enc.c

index 6374a97..e894746 100644 (file)
@@ -227,8 +227,8 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
             /* mpeg1 header repeated every gop */
             put_header(s, SEQ_START_CODE);
 
-            put_sbits(&s->pb, 12, s->width );
-            put_sbits(&s->pb, 12, s->height);
+            put_sbits(&s->pb, 12, s->width  & 0xFFF);
+            put_sbits(&s->pb, 12, s->height & 0xFFF);
 
             for(i=1; i<15; i++){
                 float error= aspect_ratio;