[vlc-commits] png: fix wrong pointer passed as callback data

Erwan Tulou git at videolan.org
Wed Feb 20 20:49:53 CET 2019


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Wed Feb 20 19:16:54 2019 +0100| [494a8a039cbe7d189a53885d393bd50cab3c0d61] | committer: Erwan Tulou

png: fix wrong pointer passed as callback data

user_warning() and user_error() expect p_sys as user data.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=494a8a039cbe7d189a53885d393bd50cab3c0d61
---

 modules/codec/png.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index 8a95588df2..402459d8e1 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -238,8 +238,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     if( setjmp( png_jmpbuf( p_png ) ) )
         goto error;
 
-    png_set_read_fn( p_png, (void *)p_block, user_read );
-    png_set_error_fn( p_png, (void *)p_dec, user_error, user_warning );
+    png_set_read_fn( p_png, p_block, user_read );
+    png_set_error_fn( p_png, p_sys, user_error, user_warning );
 
     png_read_info( p_png, p_info );
     if( p_sys->b_error ) goto error;
@@ -399,7 +399,7 @@ static block_t *EncodeBlock(encoder_t *p_enc, picture_t *p_pic)
         goto error;
 
     png_set_write_fn( p_png, p_block, user_write, user_flush );
-    png_set_error_fn( p_png, p_enc, user_error, user_warning );
+    png_set_error_fn( p_png, p_sys, user_error, user_warning );
 
     p_info = png_create_info_struct( p_png );
     if( p_info == NULL )



More information about the vlc-commits mailing list