[vlc-commits] [Git][videolan/vlc][master] x264: fix CloseEncoder called without a p_sys on error

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Feb 11 22:00:15 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
66aa6124 by Steve Lhomme at 2023-02-11T21:40:38+00:00
x264: fix CloseEncoder called without a p_sys on error

- - - - -


1 changed file:

- modules/codec/x264.c


Changes:

=====================================
modules/codec/x264.c
=====================================
@@ -1348,6 +1348,7 @@ static int  Open ( vlc_object_t *p_this )
         }
     }
     free(psz_opts);
+    p_enc->p_sys = p_sys;
 
     /* Open the encoder */
     p_sys->h = x264_encoder_open( &p_sys->param );
@@ -1404,7 +1405,6 @@ static int  Open ( vlc_object_t *p_this )
     };
 
     p_enc->ops = &ops;
-    p_enc->p_sys = p_sys;
 
     return VLC_SUCCESS;
 }
@@ -1528,4 +1528,5 @@ static void CloseEncoder( encoder_t *p_enc )
         msg_Dbg( p_enc, "framecount still in libx264 buffer: %d", x264_encoder_delayed_frames( p_sys->h ) );
         x264_encoder_close( p_sys->h );
     }
+    p_enc->p_sys = NULL;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/66aa61241d8c12935e9cf60dd3b2d4626db41213

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/66aa61241d8c12935e9cf60dd3b2d4626db41213
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