On 9/21/2017 8:51 AM, Vittorio Giovara wrote:
> ---
> This is to silence this warning (which, admittedly, could also be ignored)
> 
> cbs_h2645.c:1007:58: warning: variable 'sps_ext' is uninitialized when used 
> here [-Wuninitialized]
>     err = cbs_h264_write_sps_extension(ctx, pbc, sps_ext);
>                                                     ^~~~~~~
> cbs_h2645.c:1005:41: note: initialize the variable 'sps_ext' to silence this 
> warning
>     H264RawSPSExtension *sps_ext;
>                         ^
>                                 = NULL
> 
>  libavcodec/cbs_h2645.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> index 50a227da78..6fe138188a 100644
> --- a/libavcodec/cbs_h2645.c
> +++ b/libavcodec/cbs_h2645.c
> @@ -1002,7 +1002,7 @@ static int 
> cbs_h264_write_nal_unit(CodedBitstreamContext *ctx,
>  
>      case H264_NAL_SPS_EXT:
>          {
> -            H264RawSPSExtension *sps_ext;
> +            H264RawSPSExtension *sps_ext = NULL;

Judging by how other NAL units are handled in this function, I think
this should be

H264RawSPSExtension *sps_ext = unit->content;

Guess no fate test has a sample with an SPS ext unit?

>  
>              err = cbs_h264_write_sps_extension(ctx, pbc, sps_ext);
>              if (err < 0)
> 

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to