[vlc-devel] commit: image: filter may fail, don't crash on NULL picture ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Jan 31 20:33:28 CET 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 31 21:31:02 2010 +0200| [6cd4aa257bd2d9ea851f809b727806565d03aee7] | committer: Rémi Denis-Courmont
image: filter may fail, don't crash on NULL picture
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6cd4aa257bd2d9ea851f809b727806565d03aee7
---
src/misc/image.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/misc/image.c b/src/misc/image.c
index 3f7758d..497d073 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -339,9 +339,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
{
More information about the vlc-devel
mailing list