Commit ae0148ff authored by Michael Niedermayer's avatar 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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3dea13e7
...@@ -784,6 +784,8 @@ static int check_image_pointers(const uint8_t * const data[4], enum AVPixelForma ...@@ -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); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
int i; int i;
av_assert2(desc);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
int plane = desc->comp[i].plane; int plane = desc->comp[i].plane;
if (!data[plane] || !linesizes[plane]) if (!data[plane] || !linesizes[plane])
......
...@@ -1036,6 +1036,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, ...@@ -1036,6 +1036,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
} }
av_assert2(desc_src && desc_dst);
i = flags & (SWS_POINT | i = flags & (SWS_POINT |
SWS_AREA | SWS_AREA |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment