[FFmpeg-devel] [PATCH] avformat/apngenc: use the stream parameters extradata if no updated one is made available

James Almer jamrial at gmail.com
Tue Nov 1 04:57:57 EET 2016


On 10/31/2016 11:32 PM, James Almer wrote:
> Fixes remuxing apng streams coming from the apng demuxer.
> This is a regression since 97792e85c338d129342f5812e2a52048373e57d6.

Should be 940b8908b94404a65f9f55e33efb4ccc6c81383c, sorry.

> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavformat/apngenc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
> index e5e8aa9..2b88dcc 100644
> --- a/libavformat/apngenc.c
> +++ b/libavformat/apngenc.c
> @@ -101,6 +101,13 @@ static int apng_write_header(AVFormatContext *format_context)
>      avio_wb64(format_context->pb, PNGSIG);
>      // Remaining headers are written when they are copied from the encoder
>  
> +    apng->extra_data = av_mallocz(format_context->streams[0]->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
> +    if (!apng->extra_data)
> +        return AVERROR(ENOMEM);
> +    apng->extra_data_size =  format_context->streams[0]->codecpar->extradata_size;
> +    memcpy(apng->extra_data, format_context->streams[0]->codecpar->extradata,
> +           format_context->streams[0]->codecpar->extradata_size);
> +
>      return 0;
>  }
>  
> 



More information about the ffmpeg-devel mailing list