[xiph-commits] r19094 - trunk/theora/examples

tmatth at svn.xiph.org tmatth at svn.xiph.org
Mon Feb 17 11:59:25 PST 2014


Author: tmatth
Date: 2014-02-17 11:59:25 -0800 (Mon, 17 Feb 2014)
New Revision: 19094

Modified:
   trunk/theora/examples/dump_video.c
   trunk/theora/examples/player_example.c
Log:
examples: fix mismatched sizeof warnings


Modified: trunk/theora/examples/dump_video.c
===================================================================
--- trunk/theora/examples/dump_video.c	2014-02-16 16:21:31 UTC (rev 19093)
+++ trunk/theora/examples/dump_video.c	2014-02-17 19:59:25 UTC (rev 19094)
@@ -132,7 +132,8 @@
     xshift=pli!=0&&!(ti.pixel_fmt&1);
     yshift=pli!=0&&!(ti.pixel_fmt&2);
     ycbcr[pli].data=(unsigned char *)malloc(
-     (ti.frame_width>>xshift)*(ti.frame_height>>yshift)*sizeof(char));
+     (ti.frame_width>>xshift)*(ti.frame_height>>yshift)*
+     sizeof(*ycbcr[pli].data));
     ycbcr[pli].stride=ti.frame_width>>xshift;
     ycbcr[pli].width=ti.frame_width>>xshift;
     ycbcr[pli].height=ti.frame_height>>yshift;

Modified: trunk/theora/examples/player_example.c
===================================================================
--- trunk/theora/examples/player_example.c	2014-02-16 16:21:31 UTC (rev 19093)
+++ trunk/theora/examples/player_example.c	2014-02-17 19:59:25 UTC (rev 19094)
@@ -331,7 +331,7 @@
                                      SDL_YUY2_OVERLAY,
                                      screen);
   else if (px_fmt==TH_PF_444) {
-    RGBbuffer = calloc(sizeof(char),w*h*4);
+    RGBbuffer = calloc(w*h*4,sizeof(*RGBbuffer));
     fprintf(stderr,"warning: SDL does not support YUV 4:4:4, using slow software conversion.\n");
   } else
     yuv_overlay = SDL_CreateYUVOverlay(w, h,



More information about the commits mailing list