[FFmpeg-cvslog] swscale: Assert that pixel format descriptor is not NULL
Michael Niedermayer
git at videolan.org
Fri Jun 12 15:29:58 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun 12 14:39:28 2015 +0200| [ae0148ff60cbf0e1d81f86f7300280bb48056c71] | committer: Michael Niedermayer
swscale: Assert that pixel format descriptor is not NULL
This may help static analyzers, the pixel format is checked
during initialization
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae0148ff60cbf0e1d81f86f7300280bb48056c71
---
libswscale/swscale.c | 2 ++
libswscale/utils.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 5312016..1945e1d 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -784,6 +784,8 @@ static int check_image_pointers(const uint8_t * const data[4], enum AVPixelForma
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
int i;
+ av_assert2(desc);
+
for (i = 0; i < 4; i++) {
int plane = desc->comp[i].plane;
if (!data[plane] || !linesizes[plane])
diff --git a/libswscale/utils.c b/libswscale/utils.c
index f9f4ec6..0c78d75 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1036,6 +1036,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
return AVERROR(EINVAL);
}
}
+ av_assert2(desc_src && desc_dst);
i = flags & (SWS_POINT |
SWS_AREA |
More information about the ffmpeg-cvslog
mailing list