[FFmpeg-devel] [PATCH] avcodec/decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext

Michael Niedermayer michael at niedermayer.cc
Sat Jul 21 02:23:39 EEST 2018


On Thu, Jul 19, 2018 at 10:54:23PM -0300, James Almer wrote:
> Certain AVCodecParameters, like the contents of the extradata, may be changed
> by the init() function of any of the bitstream filters in the chain.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> Things worked fine without this until now by pure chance. vp9_superframe_split
> doesn't use extradata, and those hardware decoders inserting h264_mp4toannexb
> and hevc_mp4toannexb passed the extradata to functions that could handle it
> unfiltered.
> 
>  libavcodec/decode.c | 4 ++++
>  1 file changed, 4 insertions(+)

this breaks:
./ffmpeg -i https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png -bitexact -pix_fmt rgba -f framecrc -
...
[apng @ 0x2d431c0] chunk too big
[apng @ 0x2d44380] chunk too big
[apng @ 0x2d45b40] chunk too big
[apng @ 0x2d472c0] chunk too big
[apng @ 0x2d48a40] chunk too big
[apng @ 0x2d4a1c0] chunk too big
[apng @ 0x2d4b940] chunk too big
[apng @ 0x2d4d0c0] chunk too big
[apng @ 0x2d4e840] chunk too big
[apng @ 0x2d4ffc0] chunk too big
[apng @ 0x2d5fc00] chunk too big
[apng @ 0x2d612c0] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d62900] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d431c0] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d44380] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d45b40] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d472c0] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d48a40] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d4a1c0] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input
[apng @ 0x2d4b940] chunk too big
Error while decoding stream #0:0: Invalid data found when processing input


> 
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index 6a3a4df179..0c8cdd5bd2 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -246,6 +246,10 @@ static int bsfs_init(AVCodecContext *avctx)
>              goto fail;
>      }
>  
> +    ret = avcodec_parameters_to_context(avctx, s->bsfs[s->nb_bsfs - 1]->par_out);
> +    if (ret < 0)
> +        return ret;
> +
>      return 0;
>  fail:
>      ff_decode_bsfs_uninit(avctx);
> -- 
> 2.18.0
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180721/e8293915/attachment.sig>


More information about the ffmpeg-devel mailing list