Message ID | 20210322205833.14541-2-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 80472438996ed1928b30f6ac4e0d17a492de2cdf |
Headers | show |
Series | [FFmpeg-devel,1/6] avcodec/h264_slice: Check input SPS in ff_h264_update_thread_context() | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
On Mon, Mar 22, 2021 at 09:58:29PM +0100, Michael Niedermayer wrote: > Fixes: null pointer dereference > Fixes: h264_slice_header_init.mp4 > > Found-by: Rafael Dutra <rafael.dutra@cispa.de> > Tested-by: Rafael Dutra <rafael.dutra@cispa.de> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/h264_slice.c | 5 +++++ > 1 file changed, 5 insertions(+) will apply [...]
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 910d8b8848..62f7a61aed 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -921,6 +921,11 @@ static int h264_slice_header_init(H264Context *h) const SPS *sps = h->ps.sps; int i, ret; + if (!sps) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + ff_set_sar(h->avctx, sps->sar); av_pix_fmt_get_chroma_sub_sample(h->avctx->pix_fmt, &h->chroma_x_shift, &h->chroma_y_shift);