Commit 6950cca9 authored by Stefano Sabatini's avatar Stefano Sabatini
Browse files

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
parent 16bacad4
......@@ -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;
......
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