Bug 559343 - Silence a Coverity warning in libtheora. r=timeless
authorTim Terriberry <tterribe@vt.edu>
Thu, 29 Apr 2010 12:11:40 +1200
changeset 41622 756f81db342bfc1cade19682bdbd4ecafe3eda3a
parent 41621 c34e4f1eb78aab8a2eb65dc4fde1998a129dcdd9
child 41623 4efebc9638e76eb9e4d2078fccc4314299636ba9
push idunknown
push userunknown
push dateunknown
reviewerstimeless
bugs559343
milestone1.9.3a5pre
Bug 559343 - Silence a Coverity warning in libtheora. r=timeless
media/libtheora/README_MOZILLA
media/libtheora/bug559343.patch
media/libtheora/lib/state.c
media/libtheora/update.sh
--- a/media/libtheora/README_MOZILLA
+++ b/media/libtheora/README_MOZILLA
@@ -1,5 +1,7 @@
 The source from this directory was copied from the theora subversion trunk
 using the update.sh script. The changes made were those applied by update.sh,
 the addition/update of Makefile.in files for the Mozilla build system.
 
 The subversion revision used was r16712.
+
+bug559343.patch: Silence Coverity warning.
new file mode 100644
--- /dev/null
+++ b/media/libtheora/bug559343.patch
@@ -0,0 +1,22 @@
+diff --git a/media/libtheora/lib/state.c b/media/libtheora/lib/state.c
+--- a/media/libtheora/lib/state.c
++++ b/media/libtheora/lib/state.c
+@@ -87,17 +87,17 @@ static void oc_sb_create_plane_mapping(o
+       int       quadi;
+       int       i;
+       /*Figure out how many rows of blocks in this super block lie within the
+          image.*/
+       jmax=_hfrags-x;
+       if(jmax>4)jmax=4;
+       else if(jmax<=0)break;
+       /*By default, set all fragment indices to -1.*/
+-      memset(_sb_maps[sbi][0],0xFF,sizeof(_sb_maps[sbi]));
++      memset(_sb_maps[sbi],0xFF,sizeof(_sb_maps[sbi]));
+       /*Fill in the fragment map for this super block.*/
+       xfrag=yfrag+x;
+       for(i=0;i<imax;i++){
+         int j;
+         for(j=0;j<jmax;j++){
+           _sb_maps[sbi][SB_MAP[i][j][0]][SB_MAP[i][j][1]]=xfrag+j;
+         }
+         xfrag+=_hfrags;
--- a/media/libtheora/lib/state.c
+++ b/media/libtheora/lib/state.c
@@ -87,17 +87,17 @@ static void oc_sb_create_plane_mapping(o
       int       quadi;
       int       i;
       /*Figure out how many rows of blocks in this super block lie within the
          image.*/
       jmax=_hfrags-x;
       if(jmax>4)jmax=4;
       else if(jmax<=0)break;
       /*By default, set all fragment indices to -1.*/
-      memset(_sb_maps[sbi][0],0xFF,sizeof(_sb_maps[sbi]));
+      memset(_sb_maps[sbi],0xFF,sizeof(_sb_maps[sbi]));
       /*Fill in the fragment map for this super block.*/
       xfrag=yfrag+x;
       for(i=0;i<imax;i++){
         int j;
         for(j=0;j<jmax;j++){
           _sb_maps[sbi][SB_MAP[i][j][0]][SB_MAP[i][j][1]]=xfrag+j;
         }
         xfrag+=_hfrags;
--- a/media/libtheora/update.sh
+++ b/media/libtheora/update.sh
@@ -55,8 +55,9 @@ cp $1/lib/x86_vc/mmxidct.c ./lib/x86_vc/
 cp $1/lib/x86_vc/mmxloop.h ./lib/x86_vc/
 cp $1/lib/x86_vc/mmxstate.c ./lib/x86_vc/
 cp $1/lib/x86_vc/x86int.h ./lib/x86_vc/
 cp $1/lib/x86_vc/x86state.c ./lib/x86_vc/
 cp $1/include/theora/theora.h ./include/theora/theora.h
 cp $1/include/theora/theoradec.h ./include/theora/theoradec.h
 cp $1/include/theora/theoraenc.h ./include/theora/theoraenc.h
 cp $1/include/theora/codec.h ./include/theora/codec.h
+patch -p3 <bug559343.patch