Skip to content

Commit

Permalink
avutil/imgutils: Simplify pix_fmt validity check in av_image_get_line…
Browse files Browse the repository at this point in the history
…size()

Found-by: Daemon404
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jun 12, 2015
1 parent 2cbadf5 commit ea37df2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavutil/imgutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
int max_step [4]; /* max pixel step for each plane */
int max_step_comp[4]; /* the component for each plane which has the max pixel step */

if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
return AVERROR(EINVAL);

av_image_fill_max_pixsteps(max_step, max_step_comp, desc);
Expand Down

0 comments on commit ea37df2

Please sign in to comment.