Browse Source

qsvdec: Release packet on decoding failure for mpeg2/vp8/vc1

H264/265 have been fixed such an issue with commit
559370f2c4.
Similar fixing is needed for other codecs.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n4.1
Zhong Li Luca Barbato 7 years ago
parent
commit
69caad8959
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavcodec/qsvdec_other.c

+ 6
- 1
libavcodec/qsvdec_other.c View File

@@ -138,8 +138,13 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data,
} }


ret = ff_qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->input_ref); ret = ff_qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->input_ref);
if (ret < 0)
if (ret < 0) {
/* Drop input packet when failed to decode the packet. Otherwise,
the decoder will keep decoding the failure packet. */
av_packet_unref(&s->input_ref);

return ret; return ret;
}


s->input_ref.size -= ret; s->input_ref.size -= ret;
s->input_ref.data += ret; s->input_ref.data += ret;


Loading…
Cancel
Save