X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fimage.c;h=7a6457262034a739d6b97920491416bc96e2f5a2;hb=55b7b5bdb7e65e94465d4ff5660cfc2964d7a18f;hp=3f7758d85d2b59e1a41a9d53301b5aab1c5ee10d;hpb=27cdd6eb494feb8da6ea6fd4112b1b066b5f4f3a;p=vlc diff --git a/src/misc/image.c b/src/misc/image.c index 3f7758d85d..7a64572620 100644 --- a/src/misc/image.c +++ b/src/misc/image.c @@ -43,9 +43,10 @@ #include #include #include -#include +#include #include #include +#include static picture_t *ImageRead( image_handler_t *, block_t *, video_format_t *, video_format_t * ); @@ -74,11 +75,12 @@ vlc_fourcc_t image_Type2Fourcc( const char * ); vlc_fourcc_t image_Ext2Fourcc( const char * ); /*static const char *Fourcc2Ext( vlc_fourcc_t );*/ +#undef image_HandlerCreate /** * Create an image_handler_t instance * */ -image_handler_t *__image_HandlerCreate( vlc_object_t *p_this ) +image_handler_t *image_HandlerCreate( vlc_object_t *p_this ) { image_handler_t *p_image = calloc( 1, sizeof(image_handler_t) ); if( !p_image ) @@ -339,9 +341,15 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic, p_tmp_pic = p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic ); - p_block = p_image->p_enc->pf_encode_video( p_image->p_enc, p_tmp_pic ); - - p_image->p_filter->pf_video_buffer_del( p_image->p_filter, p_tmp_pic ); + if( likely(p_tmp_pic != NULL) ) + { + p_block = p_image->p_enc->pf_encode_video( p_image->p_enc, + p_tmp_pic ); + p_image->p_filter->pf_video_buffer_del( p_image->p_filter, + p_tmp_pic ); + } + else + p_block = NULL; } else { @@ -370,7 +378,7 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic, p_fmt_out->i_chroma = image_Ext2Fourcc( psz_url ); } - file = utf8_fopen( psz_url, "wb" ); + file = vlc_fopen( psz_url, "wb" ); if( !file ) { msg_Err( p_image->p_parent, "%s: %m", psz_url );