From 9473268cfb580dccd3f1f3be338cd22661ef791e Mon Sep 17 00:00:00 2001 From: Linjie Fu Date: Tue, 17 Mar 2020 22:53:58 +0800 Subject: lavc/vp9: fix reference frame dimensions check for SINGLE_REFERENCE mode 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: Signed-off-by: Linjie Fu Signed-off-by: Ronald S. Bultje --- libavcodec/vp9dec.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/vp9dec.h') diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h index de02b146f0..e203666bb4 100644 --- a/libavcodec/vp9dec.h +++ b/libavcodec/vp9dec.h @@ -36,6 +36,8 @@ #include "vp9dsp.h" #include "vp9shared.h" +#define REF_INVALID_SCALE 0xFFFF + enum MVJoint { MV_JOINT_ZERO, MV_JOINT_H, @@ -221,6 +223,9 @@ struct VP9TileData { struct { int x, y; } min_mv, max_mv; int16_t *block_base, *block, *uvblock_base[2], *uvblock[2]; uint8_t *eob_base, *uveob_base[2], *eob, *uveob[2]; + + // error message + int error_info; }; void ff_vp9_fill_mv(VP9TileData *td, VP56mv *mv, int mode, int sb); -- cgit v1.2.3