ffmpeg | branch: release/3.3 | James Almer <jamr...@gmail.com> | Mon Mar 18 17:25:58 2019 -0300| [884ecede17017bb5b56f547e66f13a505636f6de] | committer: James Almer
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.buitenh...@gmail.com> Signed-off-by: James Almer <jamr...@gmail.com> (cherry picked from commit 70c8c8a818f39bc262565ec29fae2baffb3e1660) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=884ecede17017bb5b56f547e66f13a505636f6de --- libavcodec/hevcdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index db0bebfa49..776bb8f51c 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2799,6 +2799,10 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) return ret; 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->nal_unit_type == HEVC_NAL_CRA_NUT || IS_BLA(s)) { s->max_ra = s->poc; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog