diff --git a/examples/dump_video.c b/examples/dump_video.c index 4edbf25900207793527dcab1cb1e44d197e4dcdc..9b4b401b5232d2e975327952ebf64da51c0c94dc 100644 --- a/examples/dump_video.c +++ b/examples/dump_video.c @@ -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; diff --git a/examples/player_example.c b/examples/player_example.c index db49cb17ff3989d447672e60de7ef1620c2822c2..913692e09e6edffc76acc805b4b674add331373c 100644 --- a/examples/player_example.c +++ b/examples/player_example.c @@ -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,