theoradec: fix buffer overrun on 422 decode.
authorMichael Smith <msmith@syncword.(none)>
Tue, 28 Apr 2009 05:42:55 +0000 (22:42 -0700)
committerMichael Smith <msmith@syncword.(none)>
Mon, 11 May 2009 01:08:13 +0000 (18:08 -0700)
ext/theora/theoradec.c

index 7494139..bd89b2a 100644 (file)
@@ -1219,7 +1219,7 @@ theora_handle_422_image (GstTheoraDec * dec, yuv_buffer * yuv, GstBuffer ** out)
 
       curdest = dest + 1;
       src = src_cb;
-      for (j = 0; j < width; j++) {
+      for (j = 0; j < width / 2; j++) {
         *curdest = *src++;
         curdest += 4;
       }
@@ -1227,7 +1227,7 @@ theora_handle_422_image (GstTheoraDec * dec, yuv_buffer * yuv, GstBuffer ** out)
 
       curdest = dest + 3;
       src = src_cr;
-      for (j = 0; j < width; j++) {
+      for (j = 0; j < width / 2; j++) {
         *curdest = *src++;
         curdest += 4;
       }