[FFmpeg-cvslog] avfilter/drawutils: Assert av_pix_fmt_desc_get() return value in ff_fill_line_with_color()
Michael Niedermayer
git at videolan.org
Sat Jun 13 21:46:41 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun 12 23:40:09 2015 +0200| [a98d4d5207502a6dace278e69db288da0c192a28] | committer: Michael Niedermayer
avfilter/drawutils: Assert av_pix_fmt_desc_get() return value in ff_fill_line_with_color()
Theres currently no case where this could be triggered
Found-by: Daemon404
Reviewed-by: Nicolas George <george at nsup.org>
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a98d4d5207502a6dace278e69db288da0c192a28
---
libavfilter/drawutils.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 3a1abbd..5a82b10 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -21,6 +21,7 @@
#include <string.h>
+#include "libavutil/avassert.h"
#include "libavutil/avutil.h"
#include "libavutil/colorspace.h"
#include "libavutil/mem.h"
@@ -66,7 +67,11 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t
uint8_t rgba_map[4] = {0};
int i;
const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
- int hsub = pix_desc->log2_chroma_w;
+ int hsub;
+
+ av_assert0(pix_desc);
+
+ hsub = pix_desc->log2_chroma_w;
*is_packed_rgba = ff_fill_rgba_map(rgba_map, pix_fmt) >= 0;
More information about the ffmpeg-cvslog
mailing list