hevc: do not dereference pointer before NULL check in verify_md5()

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Michael Niedermayer 2013-12-10 15:42:26 +01:00 committed by Anton Khirnov
parent 3bb91a1b5c
commit b769cf4b44
1 changed files with 3 additions and 1 deletions

View File

@ -2765,12 +2765,14 @@ static void print_md5(void *log_ctx, int level, uint8_t md5[16])
static int verify_md5(HEVCContext *s, AVFrame *frame)
{
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;
if (!desc)
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: ",
s->poc);