summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-09-11 13:42:09 -0300
committerJames Almer <jamrial@gmail.com>2018-09-11 13:42:09 -0300
commit23ce57af3ad684363881cdd66d5724f40963a65c (patch)
tree543287ea61f02585a7f8b6c77d0b7aac6d2011a9 /libavcodec
parent50ae1f7e0ff1fa00236622415039f7e28d919a25 (diff)
parent69caad8959982580504643d36aef22528e4aa6ce (diff)
Merge commit '69caad8959982580504643d36aef22528e4aa6ce'
* commit '69caad8959982580504643d36aef22528e4aa6ce': qsvdec: Release packet on decoding failure for mpeg2/vp8/vc1 Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-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 f6e08a2a84..993c7a8e80 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;