examples: fix mismatched sizeof warnings
authorTristan Matthews <le.businessman@gmail.com>
Mon, 17 Feb 2014 19:59:25 +0000 (19:59 +0000)
committerTristan Matthews <le.businessman@gmail.com>
Mon, 17 Feb 2014 19:59:25 +0000 (19:59 +0000)
git-svn-id: http://svn.xiph.org/trunk/theora@19094 0101bb08-14d6-0310-b084-bc0e0c8e3800

examples/dump_video.c
examples/player_example.c

index 4edbf25..9b4b401 100644 (file)
@@ -132,7 +132,8 @@ static void open_video(void){
     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;
index db49cb1..913692e 100644 (file)
@@ -331,7 +331,7 @@ static void open_video(void){
                                      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,