[FFmpeg-cvslog] hevc: do not dereference pointer before NULL check in verify_md5()

Michael Niedermayer git at videolan.org
Wed Dec 11 23:14:47 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 10 15:42:26 2013 +0100| [b769cf4b44c8112827c2fdfcab74bd95600fd6d3] | committer: Anton Khirnov

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

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b769cf4b44c8112827c2fdfcab74bd95600fd6d3
---

 libavcodec/hevc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 6b935b6..b7e7757 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);
 



More information about the ffmpeg-cvslog mailing list