[vlc-commits] [Git][videolan/vlc][master] mediacodec: free format returned by getOutputFormat
    Steve Lhomme (@robUx4) 
    gitlab at videolan.org
       
    Fri Sep 20 08:39:30 UTC 2024
    
    
  
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
d0fc525c by Mangal Kushwah at 2024-09-20T08:20:35+00:00
mediacodec: free format returned by getOutputFormat
- - - - -
1 changed file:
- modules/codec/omxil/mediacodec_ndk.c
Changes:
=====================================
modules/codec/omxil/mediacodec_ndk.c
=====================================
@@ -500,6 +500,8 @@ static int GetOutput(mc_api *api, int i_index, mc_api_out *p_out)
     else if (i_index == MC_API_INFO_OUTPUT_FORMAT_CHANGED)
     {
         AMediaFormat *format = syms.AMediaCodec.getOutputFormat(p_sys->p_codec);
+        if (unlikely(format == NULL))
+            return MC_API_ERROR;
 
         p_out->type = MC_OUT_TYPE_CONF;
         p_out->b_eos = false;
@@ -521,6 +523,7 @@ static int GetOutput(mc_api *api, int i_index, mc_api_out *p_out)
             p_out->conf.audio.channel_mask  = GetFormatInteger(format, "channel-mask");
             p_out->conf.audio.sample_rate   = GetFormatInteger(format, "sample-rate");
         }
+        syms.AMediaFormat.delete(format);
         return 1;
     }
     return 0;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d0fc525c565d7419993709b5fd9e0a63d58614e8
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d0fc525c565d7419993709b5fd9e0a63d58614e8
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