mirror of https://code.videolan.org/videolan/vlc
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.
This commit is contained in:
parent
0801b577b2
commit
86e598311e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue