1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-16 03:44:15 +02:00

h264: on reference overflow, reset the reference count to 0, not 1.

Since decode_slice_header() returns before the reference lists are
constructed, there are zero valid references.

CC:libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-02-14 11:43:20 +01:00
parent e671d3ad6c
commit 668e16a0dd

View File

@ -3391,7 +3391,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
if (h->ref_count[0] > max_refs || h->ref_count[1] > max_refs) {
av_log(h->avctx, AV_LOG_ERROR, "reference overflow\n");
h->ref_count[0] = h->ref_count[1] = 1;
h->ref_count[0] = h->ref_count[1] = 0;
return AVERROR_INVALIDDATA;
}