avcodec/h264_slice: Check input SPS in ff_h264_update_thread_context()

Fixes: crash
Fixes: check_pkt.mp4

Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ceae92cb29)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-03-20 14:36:28 +01:00
parent 94c0877dd0
commit 7cafb6461d
1 changed files with 2 additions and 3 deletions

View File

@ -296,9 +296,8 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
if (dst == src)
return 0;
// We can't fail if SPS isn't set at it breaks current skip_frame code
//if (!h1->ps.sps)
// return AVERROR_INVALIDDATA;
if (inited && !h1->ps.sps)
return AVERROR_INVALIDDATA;
if (inited &&
(h->width != h1->width ||