On Fri, Apr 15, 2016 at 10:37 AM, Rodger Combs <rodger.co...@gmail.com> wrote:
> ---
>  libavformat/mux.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 33301f1..0ed0c3d 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -1054,6 +1054,16 @@ int av_interleaved_write_frame(AVFormatContext *s, 
> AVPacket *pkt)
>              }
>          }
>
> +        if (!st->internal->avctx->extradata && st->codecpar->extradata) {
> +            int size = st->codecpar->extradata_size;
> +            if (size < 0 || size >= INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
> +                return AVERROR(EINVAL);
> +            st->internal->avctx->extradata = av_mallocz(size + 
> AV_INPUT_BUFFER_PADDING_SIZE);
> +            if (!st->internal->avctx->extradata)
> +                return AVERROR(ENOMEM);
> +            st->internal->avctx->extradata_size = size;
> +            memcpy(st->internal->avctx->extradata, st->codecpar->extradata, 
> size);
> +        }
>          av_apply_bitstream_filters(st->internal->avctx, pkt, 
> st->internal->bsfc);
>          if (pkt->size == 0 && pkt->side_data_elems == 0)
>              return 0;
> --
> 2.7.3

Derek is actively working on merging the new BSF API right now, it
might be better to just update this to the new API instead of wasting
some time on the old one.
It solves a bunch of these problems by accepting codecpar directly.

- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to