mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
h264: reset ref count if decoding the slice header fails
Otherwise the ER code might try to use some already freed references. Fixes possible access to freed memory. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
This commit is contained in:
parent
98cc9efc5f
commit
0652e024c6
@ -4813,9 +4813,10 @@ again:
|
|||||||
context_count = 0;
|
context_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err < 0)
|
if (err < 0) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
|
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
|
||||||
else if (err == 1) {
|
h->ref_count[0] = h->ref_count[1] = h->list_count = 0;
|
||||||
|
} else if (err == 1) {
|
||||||
/* Slice could not be decoded in parallel mode, copy down
|
/* Slice could not be decoded in parallel mode, copy down
|
||||||
* NAL unit stuff to context 0 and restart. Note that
|
* NAL unit stuff to context 0 and restart. Note that
|
||||||
* rbsp_buffer is not transferred, but since we no longer
|
* rbsp_buffer is not transferred, but since we no longer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user