[vlc-commits] [Git][videolan/vlc][3.0.x] avcodec: fix crash when AV1 hardware decoder fails
    Jean-Baptiste Kempf (@jbk) 
    gitlab at videolan.org
       
    Sun Oct 22 17:32:06 UTC 2023
    
    
  
Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC
Commits:
585aee4f by Steve Lhomme at 2023-10-21T17:08:40+00:00
avcodec: fix crash when AV1 hardware decoder fails
If InitVideoDecCommon() fails, it's already cleaning the decoder,
release the context and freeing p_sys.
We must not do anything and just return the error.
(cherry picked from commit fecebe158883b832076fb396ad671255865f61a4)
- - - - -
1 changed file:
- modules/codec/avcodec/video.c
Changes:
=====================================
modules/codec/avcodec/video.c
=====================================
@@ -788,7 +788,7 @@ int InitVideoHwDec( vlc_object_t *obj )
 
     int res = InitVideoDecCommon( p_dec );
     if (res != VLC_SUCCESS)
-        goto not_usable;
+        return res;
 
     const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(p_context->sw_pix_fmt);
 
@@ -799,7 +799,6 @@ int InitVideoHwDec( vlc_object_t *obj )
             return VLC_SUCCESS;
     }
 
-not_usable:
     EndVideoDec(obj);
     return VLC_EGENERIC;
 failed:
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/585aee4fad69dc5b6b4fa6ddfc0c50b52a1be273
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/585aee4fad69dc5b6b4fa6ddfc0c50b52a1be273
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