comparison libvo/vo_vesa.c @ 29062:6a0a30aa2b4a

Consistently use MP_MAX_PLANES as size for plane pointer/stride arrays in libvo. This might avoid some issues since sws_scale in some cases assumes these have at least 4 valid entries.
author reimar
date Sun, 29 Mar 2009 14:37:21 +0000
parents df67d03dde3b
children 0f1b5b68af32
comparison
equal deleted inserted replaced
29061:76d3bebf4e45 29062:6a0a30aa2b4a
281 281
282 /* is called for yuv only */ 282 /* is called for yuv only */
283 static int draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) 283 static int draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
284 { 284 {
285 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; 285 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW;
286 uint8_t *dst[3]= {dga_buffer, NULL, NULL}; 286 uint8_t *dst[MP_MAX_PLANES]={dga_buffer};
287 int dstStride[3]; 287 int dstStride[MP_MAX_PLANES]={0};
288 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) 288 if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
289 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y); 289 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y);
290 dstStride[0]=dstride*((dstBpp+7)/8); 290 dstStride[0]=dstride*((dstBpp+7)/8);
291 dstStride[1]= 291 dstStride[1]=
292 dstStride[2]=dstStride[0]>>1; 292 dstStride[2]=dstStride[0]>>1;
421 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_frame was called\n"); 421 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_frame was called\n");
422 if(sws) 422 if(sws)
423 { 423 {
424 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; 424 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW;
425 int srcStride[1]; 425 int srcStride[1];
426 uint8_t *dst[3]= {dga_buffer, NULL, NULL}; 426 uint8_t *dst[MP_MAX_PLANES]={dga_buffer};
427 int dstStride[3]; 427 int dstStride[MP_MAX_PLANES]={0};
428 dstStride[0]=dstride*((dstBpp+7)/8); 428 dstStride[0]=dstride*((dstBpp+7)/8);
429 dstStride[1]= 429 dstStride[1]=
430 dstStride[2]=dstStride[0]>>1; 430 dstStride[2]=dstStride[0]>>1;
431 if(srcFourcc == IMGFMT_RGB32 || srcFourcc == IMGFMT_BGR32) 431 if(srcFourcc == IMGFMT_RGB32 || srcFourcc == IMGFMT_BGR32)
432 srcStride[0] = srcW*4; 432 srcStride[0] = srcW*4;