[FFmpeg-devel] [PATCH 1/2] avcodec/av1: only set the private context pix_fmt field if get_pixel_format() succeeds

Michael Niedermayer michael at niedermayer.cc
Wed Mar 23 14:22:47 EET 2022


On Tue, Mar 22, 2022 at 04:10:59PM -0300, James Almer wrote:
> Otherwise get_pixel_format() will not be called when parsing a subsequent Sequence
> Header in non hwaccel enabled scenarios, allowing frame parsing when it shouldn't.
> 
> This prevents the scenario seqhdr -> frame_hdr/redundant_frame_hdr -> seqhdr ->
> redundant_frame_hdr from having the latter redundant frame header parsed as if it
> was a frame header by the decoder because the former was discarded.
> Since CBS did not discard it, the latter redundant frame header is output with a
> zeroed AV1RawFrameHeader struct, which can have undesired results, like division
> by zero with fields normally guaranteed to be anything else.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/av1dec.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

This patchset fixes the 2 issues too

thx

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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/20220323/0fdb9ef7/attachment.sig>


More information about the ffmpeg-devel mailing list