aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-20 00:35:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-20 00:35:18 +0200
commitf2eca8d06060b9ec265c21ae38b6dd3088c52cc6 (patch)
treefecedba832d63523df8989c712b21cb6363fb1a1 /libavcodec
parentacecd6b4d7fd7ca7e8a37e9c0aa4bc1868a5ae93 (diff)
downloadffmpeg-f2eca8d06060b9ec265c21ae38b6dd3088c52cc6.tar.gz
avcodec/hevc: do not dereference pointer before null check in verify_md5()
Fixes: CID1108607 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/hevc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 393556e81b..eb44862a2c 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -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)
{
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);