Commit f2eca8d0 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/hevc: do not dereference pointer before null check in verify_md5()

Fixes: CID1108607
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent acecd6b4
...@@ -2196,12 +2196,14 @@ static void print_md5(void *log_ctx, int level, uint8_t md5[16]) ...@@ -2196,12 +2196,14 @@ static void print_md5(void *log_ctx, int level, uint8_t md5[16])
static int verify_md5(HEVCContext *s, AVFrame *frame) static int verify_md5(HEVCContext *s, AVFrame *frame)
{ {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
int pixel_shift = desc->comp[0].depth_minus1 > 7; int pixel_shift;
int i, j; int i, j;
if (!desc) if (!desc)
return AVERROR(EINVAL); return AVERROR(EINVAL);
pixel_shift = desc->comp[0].depth_minus1 > 7;
av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ", av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ",
s->poc); s->poc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment