mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
avpicture: Don't assume a valid pix fmt in avpicture_get_size
When called from the v4l2 input device, pix_fmt can be
AV_PIX_FMT_NONE (for jpeg formats). Before 50ba57e0, this wasn't
an issue for avpicture_get_size, but after that commit, this
lead to crashes.
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
a394959bbe
commit
2c96392277
1 changed files with 2 additions and 0 deletions
|
|
@ -88,6 +88,8 @@ int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
|
|||
AVPicture dummy_pict;
|
||||
int ret;
|
||||
|
||||
if (!desc)
|
||||
return AVERROR(EINVAL);
|
||||
if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
|
||||
return ret;
|
||||
if (desc->flags & PIX_FMT_PSEUDOPAL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue