mirror of https://github.com/FFmpeg/FFmpeg.git
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>release/7.1
parent
73676dd47a
commit
c85508f5a9
1 changed files with 8 additions and 8 deletions
Loading…
Reference in new issue