[vlc-devel] [PATCH] egl: prevent a potential null-dereference

Zhao Zhili quinkblack at foxmail.com
Tue Oct 16 15:13:57 CEST 2018


On 2018年10月16日 20:39, Thomas Guillem wrote:
> Hello,
>
> I quote the EGL doc here:
> https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglQueryString.xhtml
>
> "EGL_EXTENSIONS
>      Returns a space separated list of supported extensions to EGL. If there are no extensions, then the empty string is returned. "
>
> So, the case you are fixing should not happen.
>
> But since there a lot of buggy EGL implementations in the wild, I guess it can finally.
>
> Can you tell us how you reproduce this crash ? OS/GPU/Drivers/Sample

On the same page it says "NULL is returned on failure". Not sure if it 
can fail in real case, maybe never.

>
> On Tue, Oct 16, 2018, at 14:25, Zhao Zhili wrote:
>> ---
>>   modules/video_output/opengl/egl.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/
>> opengl/egl.c
>> index dec85f8..f8d0bd5 100644
>> --- a/modules/video_output/opengl/egl.c
>> +++ b/modules/video_output/opengl/egl.c
>> @@ -322,7 +322,7 @@ static int Open (vlc_object_t *obj, const struct
>> gl_api *api)
>>               eglQueryString(sys->display, EGL_VENDOR));
>>   
>>       const char *ext = eglQueryString(sys->display, EGL_EXTENSIONS);
>> -    if (*ext)
>> +    if (ext && *ext)
>>           msg_Dbg(obj, " extensions: %s", ext);
>>   
>>       if (major != 1 || minor < api->min_minor
>> -- 
>> 2.9.5
>>
>>
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel





More information about the vlc-devel mailing list