Browse Source

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@gmx.at>
tags/n2.8
Michael Niedermayer 10 years ago
parent
commit
ae0148ff60
2 changed files with 3 additions and 0 deletions
  1. +2
    -0
      libswscale/swscale.c
  2. +1
    -0
      libswscale/utils.c

+ 2
- 0
libswscale/swscale.c View File

@@ -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])


+ 1
- 0
libswscale/utils.c View File

@@ -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 |


Loading…
Cancel
Save