[xiph-commits] r15371 - trunk/theora/lib/enc

tterribe at svn.xiph.org tterribe at svn.xiph.org
Fri Oct 3 16:08:14 PDT 2008


Author: tterribe
Date: 2008-10-03 16:08:14 -0700 (Fri, 03 Oct 2008)
New Revision: 15371

Modified:
   trunk/theora/lib/enc/encapiwrapper.c
Log:
Fix segfault when exactly one of the width or height is not a multiple of 16,
 but the other is.
Also actually compute the correct vertical offset for chroma.


Modified: trunk/theora/lib/enc/encapiwrapper.c
===================================================================
--- trunk/theora/lib/enc/encapiwrapper.c	2008-10-03 16:06:00 UTC (rev 15370)
+++ trunk/theora/lib/enc/encapiwrapper.c	2008-10-03 23:08:14 UTC (rev 15371)
@@ -1091,7 +1091,7 @@
     int            pli;
     pic_x=cpi->pb.info.offset_x;
     pic_y=cpi->pb.info.offset_y;
-    if(_ycbcr[0].width>pic_width&&_ycbcr[0].height>pic_height){
+    if(_ycbcr[0].width>pic_width||_ycbcr[0].height>pic_height){
       buf=th_encode_copy_pad_plane(ycbcr+0,_enc->buf,_ycbcr+0,
        pic_x,pic_y,pic_width,pic_height);
     }
@@ -1108,7 +1108,7 @@
       int x0;
       int y0;
       x0=pic_x>>hdec;
-      y0=pic_x>>hdec;
+      y0=pic_y>>vdec;
       buf=th_encode_copy_pad_plane(ycbcr+pli,buf,_ycbcr+pli,
        x0,y0,(pic_x+pic_width+hdec>>hdec)-x0,(pic_y+pic_height+vdec>>vdec)-y0);
     }



More information about the commits mailing list