lavc/pngdec: always create a copy for APNG_DISPOSE_OP_BACKGROUND
authorAnton Khirnov <anton@khirnov.net>
Thu, 8 Apr 2021 08:46:54 +0000 (10:46 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 8 Apr 2021 20:55:16 +0000 (22:55 +0200)
commit2a7f1bc282ddebee296bc0ca48a85bf01b626b3b
treed61867c24664f4f8eb682629c202067124ed08bb
parent25e794a1ea13ad0ed9f5c4792ab3727fe7a3ace1
lavc/pngdec: always create a copy for APNG_DISPOSE_OP_BACKGROUND

Calling av_frame_make_writable() from decoders is tricky, especially
when frame threading is used. It is much simpler and safer to just make
a private copy of the frame.
This is not expected to have a major performance impact, since
APNG_DISPOSE_OP_BACKGROUND is not used often and
av_frame_make_writable() would typically make a copy anyway.

Found-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b593abda6c642cb0c3959752dd235c2faf66837f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pngdec.c