mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/hevcdec: decode at most one slice reporting being the first in the picture
Fixes deadlocks when decoding packets containing more than one of the aforementioned
slices when using frame threads.
Tested-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 70c8c8a818
)
This commit is contained in:
parent
3d5762380d
commit
884ecede17
|
@ -2799,6 +2799,10 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (s->sh.first_slice_in_pic_flag) {
|
if (s->sh.first_slice_in_pic_flag) {
|
||||||
|
if (s->ref) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
if (s->max_ra == INT_MAX) {
|
if (s->max_ra == INT_MAX) {
|
||||||
if (s->nal_unit_type == HEVC_NAL_CRA_NUT || IS_BLA(s)) {
|
if (s->nal_unit_type == HEVC_NAL_CRA_NUT || IS_BLA(s)) {
|
||||||
s->max_ra = s->poc;
|
s->max_ra = s->poc;
|
||||||
|
|
Loading…
Reference in New Issue