]> git.sesse.net Git - ffmpeg/commit
avcodec/mjpegdec: fix SOF check in EOI
authorJames Almer <jamrial@gmail.com>
Wed, 28 Apr 2021 14:01:57 +0000 (11:01 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 30 Apr 2021 13:09:30 +0000 (10:09 -0300)
commitfb5e2d71127ccae19c3f80ec363bb67d1871cb74
tree915d3c99b9db6faa76603ac98cfef012253b0c73
parent8b83a4a885e3b92bd09354d6cb182fca47f80973
avcodec/mjpegdec: fix SOF check in EOI

For frames decoded with skip_frame == AVDISCARD_ALL, a picture is not allocated
and got_picture is never set to 1 even if a SOF and SOS were parsed.
The existing check in EOI only cares if a SOF was parsed, not if a picture
allocated, so change it and add a new check to explicitly ensure a picture was
allocated when skip_frame != AVDISCARD_ALL.

Fixes probing and decoding when skip_frame is AVDISCARD_ALL.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/mjpegdec.c