aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-03-20 14:36:28 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-06 14:41:41 +0200
commited0134946f8c4fa1ac31ed65ea734b5a7b57a3f0 (patch)
treef1fa2af63be8c3b8d38e8e3779520aea5fd74d22
parentb5e7092c9cc603ca9312dea1f0eb2bd331784fc1 (diff)
downloadffmpeg-ed0134946f8c4fa1ac31ed65ea734b5a7b57a3f0.tar.gz
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 ceae92cb291c2536a93482cdf3c1ae3f7330b924) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/h264_slice.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 400a406440..b9136166ff 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -304,9 +304,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 ||