aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vvc/data.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-28 01:45:47 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-12 10:50:12 +0200
commitc85508f5a91cc0caf18ba33c941536bf8b99b81b (patch)
tree0ccf7aba8369d00590493b10529e8e844eca03ea /libavcodec/vvc/data.h
parent73676dd47ac36f975b430f6a60a09144357523c3 (diff)
downloadffmpeg-c85508f5a91cc0caf18ba33c941536bf8b99b81b.tar.gz
avcodec/mpeg12dec: Allocate dummy frames for non-I fields
MPEG-2 allows to pair an intra field (as first field) together with a P-field. In this case a conformant bitstream has to satisfy certain restrictions in order to ensure that only the I field is used for prediction. See section 7.6.3.5 of the MPEG-2 specifications. We do not check these restrictions; normally we simply allocate dummy frames for reference in order to avoid checks lateron. This happens in ff_mpv_frame_start() and therefore does not happen for a second field. This is inconsistent. Fix this by allocating these dummy frames for the second field, too. This already fixes two bugs: 1. Undefined pointer arithmetic in prefetch_motion() in mpegvideo_motion.c where it is simply presumed that the reference frame exists. 2. Several MPEG-2 hardware accelerations rely on last_picture being allocated for P pictures and next picture for B pictures; e.g. VDPAU returns VDP_STATUS_INVALID_HANDLE when decoding an I-P fields pair because the forward_reference was set incorrectly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vvc/data.h')
0 files changed, 0 insertions, 0 deletions