aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-10 15:42:26 +0100
committerAnton Khirnov <anton@khirnov.net>2013-12-11 20:39:54 +0100
commitb769cf4b44c8112827c2fdfcab74bd95600fd6d3 (patch)
treef435bc460f550b07d15d6522e846c05f024ee033 /libavcodec/hevc.c
parent3bb91a1b5c4a0c5ec9c4d3b6649b23285c3d7f26 (diff)
downloadffmpeg-b769cf4b44c8112827c2fdfcab74bd95600fd6d3.tar.gz
hevc: do not dereference pointer before NULL check in verify_md5()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 6b935b6dba..b7e7757fae 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -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);