1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

Merge commit 'aa9d15d89bb4ee8a31607d3db1b8c5334eb88d2d'

* commit 'aa9d15d89bb4ee8a31607d3db1b8c5334eb88d2d':
  qsvdec: avoid an infinite loop with no consumed data and no output

Conflicts:
	libavcodec/qsvdec.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2015-07-25 23:10:14 +02:00

View File

@@ -339,6 +339,13 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
break; break;
} }
/* make sure we do not enter an infinite loop if the SDK
* did not consume any data and did not return anything */
if (!sync && !bs.DataOffset) {
av_log(avctx, AV_LOG_WARNING, "A decode call did not consume any data\n");
bs.DataOffset = avpkt->size;
}
if (buffered) { if (buffered) {
qsv_fifo_relocate(q->input_fifo, bs.DataOffset); qsv_fifo_relocate(q->input_fifo, bs.DataOffset);
} else if (bs.DataOffset!=avpkt->size) { } else if (bs.DataOffset!=avpkt->size) {