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-09 22:02:20 +0200
commiteca0a942ea3f535e8252da663c711b429df2d83f (patch)
treea615d6d2d1dfc1e53be0b9757305ad27bfdcb4a2
parentc5a26f45119845bf87cd2c178a4b2bd70329f5cb (diff)
downloadffmpeg-eca0a942ea3f535e8252da663c711b429df2d83f.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 fc3d377c61..fe3c321817 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -309,9 +309,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 ||