[FFmpeg-devel] [PATCH, v4] lavc/vp9: fix reference frame dimensions check for SINGLE_REFERENCE mode

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Mar 19 15:03:43 EET 2020



> Am 19.03.2020 um 13:10 schrieb Ronald S. Bultje <rsbultje at gmail.com>:
> 
> Hi,
> 
>> On Tue, Mar 17, 2020 at 10:59 AM Linjie Fu <linjie.fu at intel.com> wrote:
>> 
>> With the description in frame size with refs semantics (SPEC 7.2.5),
>> it is a requirement of bitstream conformance that for at least one
>> reference frame has the valid dimensions.
>> 
>> Modify the check to make sure the decoder works well in SINGLE_REFERENCE
>> mode that not all reference frames have valid dimensions.
>> 
>> Check and error out if invalid reference frame is used in inter_recon.
>> 
>> One of the failure case is a 480x272 inter frame (SINGLE_REFERENCE mode)
>> with following reference pool:
>> 
>> 0.  960x544    LAST    valid
>> 1. 1920x1088 GOLDEN  invalid, but not used in single reference mode
>> 2. 1920x1088 ALTREF  invalid, but not used in single reference mode
>> 3~7  ...     Unused
>> 
>> Identical logic in libvpx:
>> <
>> https://github.com/webmproject/libvpx/blob/master/vp9/decoder/vp9_decodeframe.c#L736
>>> 
>> 
>> Signed-off-by: Linjie Fu <linjie.fu at intel.com>
>> ---
>> [v3]: replace assert with check/return, tested in both multi frame/slice
>> mode
>> [v4]: clear error_info to make decoding still work for other frames in
>> this stream
>> 
>> libavcodec/vp9.c      | 20 ++++++++++++++++++--
>> libavcodec/vp9dec.h   |  5 +++++
>> libavcodec/vp9recon.c | 10 ++++++++++
>> 3 files changed, 33 insertions(+), 2 deletions(-)
> 
> 
> LGTM, thanks for the revisions. (We have been discussing this on IRC.)

Why does this error out even if explode is not set?

Carl Eugen


More information about the ffmpeg-devel mailing list