[FFmpeg-devel] [PATCH] avcodec/h264_slice: don't copy frame data during error concealment

Michael Niedermayer michael at niedermayer.cc
Wed Mar 10 15:58:09 EET 2021


On Mon, Mar 08, 2021 at 11:36:00PM -0300, James Almer wrote:
> In addition to the fact that av_image_copy() cannot handle hardware pixel
> formats, h->short_ref[0]->f may not even be writable at this point.
> 
> Based on a patch by Hendrik Leppkes.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> This is an alternative to "avcodec/h264_slice: properly handle missing
> reference frames with hwaccel", given that I noticed that the target frame is
> not writable for example when running fate-h264-missing-frame.
> 
> To keep the current behavior of copying the frame data instead of making a
> reference, I also tried to do ff_thread_release_buffer() ->
> ff_thread_get_buffer() -> av_frame_copy(), which worked with software decoding,
> but when using the d3d11va hwaccel the av_frame_copy() call would fail.
> 
> There is a warning above this code that makes it sound like making references
> is not ideal, but considering h->short_ref[0] is not writable here it feels
> like it could be an outdated comment that someone forgot to remove.
> 
>  libavcodec/h264_slice.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

This seems to produce infinite loops with some fuzzed samples
ill mail you one privatly

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210310/36a93324/attachment.sig>


More information about the ffmpeg-devel mailing list