comparison libmpdemux/video.c @ 21952:58d083ace2f2

vc1 probing code: if sh_video->bih can't be callocated exit
author nicodvb
date Sat, 20 Jan 2007 13:14:09 +0000
parents bd3c871c93d0
children 1ca423133265
comparison
equal deleted inserted replaced
21951:bd3c871c93d0 21952:58d083ace2f2
399 } 399 }
400 400
401 401
402 if(mp_vc1_decode_sequence_header(&picture, &videobuffer[4], videobuf_len-4)) { 402 if(mp_vc1_decode_sequence_header(&picture, &videobuffer[4], videobuf_len-4)) {
403 sh_video->bih = (BITMAPINFOHEADER *) calloc(1, sizeof(BITMAPINFOHEADER) + videobuf_len); 403 sh_video->bih = (BITMAPINFOHEADER *) calloc(1, sizeof(BITMAPINFOHEADER) + videobuf_len);
404 if(sh_video->bih == NULL) {
405 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Couldn't alloc %d bytes for VC-1 extradata!\n", sizeof(BITMAPINFOHEADER) + videobuf_len);
406 return 0;
407 }
404 sh_video->bih->biSize= sizeof(BITMAPINFOHEADER) + videobuf_len; 408 sh_video->bih->biSize= sizeof(BITMAPINFOHEADER) + videobuf_len;
405 memcpy(sh_video->bih + 1, videobuffer, videobuf_len); 409 memcpy(sh_video->bih + 1, videobuffer, videobuf_len);
406 sh_video->bih->biCompression = sh_video->format; 410 sh_video->bih->biCompression = sh_video->format;
407 sh_video->bih->biWidth = sh_video->disp_w = picture.display_picture_width; 411 sh_video->bih->biWidth = sh_video->disp_w = picture.display_picture_width;
408 sh_video->bih->biHeight = sh_video->disp_h = picture.display_picture_height; 412 sh_video->bih->biHeight = sh_video->disp_h = picture.display_picture_height;