[vlc-commits] [Git][videolan/vlc][master] vlc-thumb: fix error handling

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Feb 23 07:28:03 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
86e59831 by Steve Lhomme at 2023-02-23T07:09:44+00:00
vlc-thumb: fix error handling

If the thumbnail fails, the returned picture is NULL. It is handled that way in
the snapshot() function. But libvlc_picture_retain() doesn't handle NULL
pictures.

- - - - -


1 changed file:

- doc/libvlc/vlc-thumb.c


Changes:

=====================================
doc/libvlc/vlc-thumb.c
=====================================
@@ -116,8 +116,9 @@ static void callback(const libvlc_event_t *ev, void *param)
     {
         libvlc_picture_t** pic = param;
         pthread_mutex_lock(&lock);
-        libvlc_picture_retain(ev->u.media_thumbnail_generated.p_thumbnail);
         *pic = ev->u.media_thumbnail_generated.p_thumbnail;
+        if (*pic != NULL)
+            libvlc_picture_retain(*pic);
         done = true;
         pthread_cond_signal(&wait);
         pthread_mutex_unlock(&lock);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/86e598311e2b941ed87073526e8e8c9537c29470

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/86e598311e2b941ed87073526e8e8c9537c29470
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list