diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-04-28 01:45:47 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-12 10:50:12 +0200 |
commit | c85508f5a91cc0caf18ba33c941536bf8b99b81b (patch) | |
tree | 0ccf7aba8369d00590493b10529e8e844eca03ea /libavcodec/aarch64/me_cmp_init_aarch64.c | |
parent | 73676dd47ac36f975b430f6a60a09144357523c3 (diff) | |
download | ffmpeg-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/aarch64/me_cmp_init_aarch64.c')
0 files changed, 0 insertions, 0 deletions