diff options
author | Pavel Koshevoy <pkoshevoy@gmail.com> | 2017-02-09 20:20:14 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-16 13:20:27 +0100 |
commit | e3f1b993341ec9ed542b07c4558baeea6921ed53 (patch) | |
tree | df08b087384f0f64de8096cfde0fefb58401d63d | |
parent | 5ef2f4f39480dc5caa5e5c9ad19eb49ea0a08e35 (diff) | |
download | ffmpeg-e3f1b993341ec9ed542b07c4558baeea6921ed53.tar.gz |
lavc/vda_h264_dec.c Fix NULL pointer dereference
ps.sps_list entries may be NULL, so check before dereferencing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vda_h264_dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vda_h264_dec.c b/libavcodec/vda_h264_dec.c index 92839e2d39..972bd6bbd6 100644 --- a/libavcodec/vda_h264_dec.c +++ b/libavcodec/vda_h264_dec.c @@ -226,7 +226,7 @@ static av_cold int vdadec_init(AVCodecContext *avctx) ctx->h264_initialized = 1; for (i = 0; i < MAX_SPS_COUNT; i++) { - const SPS *sps = (const SPS*)ctx->h264ctx.ps.sps_list[i]->data; + const SPS *sps = ctx->h264ctx.ps.sps_list[i] ? (const SPS*)ctx->h264ctx.ps.sps_list[i]->data : NULL; if (sps && (sps->bit_depth_luma != 8 || sps->chroma_format_idc == 2 || sps->chroma_format_idc == 3)) { |