diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-09-07 23:41:18 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-09-07 23:41:18 +0000 |
commit | 6950cca97fed890ec56259a2f868f37b65513d92 (patch) | |
tree | a13eeb925f9b3ddd118e44459cdda224a406e43e | |
parent | 16bacad425c22d32d822295872dd1ecb63b8c3a6 (diff) | |
download | ffmpeg-streaming-6950cca97fed890ec56259a2f868f37b65513d92.zip ffmpeg-streaming-6950cca97fed890ec56259a2f868f37b65513d92.tar.gz |
Add missing checks on invalid pixel format in
av_image_fill_linesizes/pointers.
Originally committed as revision 25072 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcore/imgutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcore/imgutils.c b/libavcore/imgutils.c index a2e913b..0a21f6d 100644 --- a/libavcore/imgutils.c +++ b/libavcore/imgutils.c @@ -66,7 +66,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt memset(linesizes, 0, 4*sizeof(linesizes[0])); - if (desc->flags & PIX_FMT_HWACCEL) + if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) return AVERROR(EINVAL); if (desc->flags & PIX_FMT_BITSTREAM) { @@ -93,7 +93,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh memset(size , 0, sizeof(size)); memset(has_plane, 0, sizeof(has_plane)); - if (desc->flags & PIX_FMT_HWACCEL) + if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) return AVERROR(EINVAL); data[0] = ptr; |