[vlc-devel] [vlc-commits] commit: Zip: fix seeking (closes #3867)
Dominique Leuenberger
dominique at leuenberger.net
Thu Jan 20 21:52:55 CET 2011
Hi Everybody,
This commit causes a new BRP check warning on my openSUSE builds.
>diff --git a/modules/access/zip/zipaccess.c
>b/modules/access/zip/zipaccess.c
>index 9f4faf4..0d092f7 100644
>--- a/modules/access/zip/zipaccess.c
>+++ b/modules/access/zip/zipaccess.c
>@@ -373,7 +373,21 @@ static void* ZCALLBACK ZipIO_Open( void* opaque,
>const char* file, int mode )
>
> access_t *p_access = (access_t*) opaque;
>
>- return stream_UrlNew( p_access, file );
>+ char *fileUri = malloc( strlen(file) + 8 );
>+ if( !fileUri ) return VLC_ENOMEM;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The issue being the function prototype requireing void* as return value
and in error case VLC_ENOMEM being returned.
Aa you can imagine, VLC_ENOMEM is int, which when being returned is
being used as a pointer. Sounds terrible wrong.
I suggest returning NULL in case of error could be the better solution?
Best regards,
Dominique
More information about the vlc-devel
mailing list