From 3dea13e710ce525375c5458fe16d6df80bd02517 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 12 Jun 2015 14:33:53 +0200
Subject: [PATCH] avcodec/jpeg2000dec: Assert that pixel format descriptor is
 not NULL

We only look up pixel formats from a fixed list so none should ever
fail to be found

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavcodec/jpeg2000dec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 6cd646a9e79..c0a8b1f1e18 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -171,6 +171,8 @@ static int pix_fmt_match(enum AVPixelFormat pix_fmt, int components,
     int match = 1;
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 
+    av_assert2(desc);
+
     if (desc->nb_components != components) {
         return 0;
     }
-- 
GitLab