summaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec_other.c
diff options
context:
space:
mode:
authorZhong Li <zhong.li@intel.com>2018-08-15 17:39:35 +0800
committerLuca Barbato <lu_zero@gentoo.org>2018-08-23 08:22:46 +0200
commit69caad8959982580504643d36aef22528e4aa6ce (patch)
treef4692024d628e32332ec4c14e326c32dec3c0d68 /libavcodec/qsvdec_other.c
parent76eef04f30a768fa80366d679f3de7e9447b67d5 (diff)
qsvdec: Release packet on decoding failure for mpeg2/vp8/vc1
H264/265 have been fixed such an issue with commit 559370f2c45110afd8308eec7194437736c323d4. 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>
Diffstat (limited to 'libavcodec/qsvdec_other.c')
-rw-r--r--libavcodec/qsvdec_other.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c
index 150ce0d2ad..47934e9530 100644
--- a/libavcodec/qsvdec_other.c
+++ b/libavcodec/qsvdec_other.c
@@ -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);
- 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;
+ }
s->input_ref.size -= ret;
s->input_ref.data += ret;