[FFmpeg-cvslog] avutil/imgutils: Simplify pix_fmt validity check in av_image_get_linesize( )

Michael Niedermayer git at videolan.org
Fri Jun 12 23:34:07 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun 12 23:23:59 2015 +0200| [ea37df2d528c15dc472e7272ac5278090f01f38e] | committer: Michael Niedermayer

avutil/imgutils: Simplify pix_fmt validity check in av_image_get_linesize()

Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea37df2d528c15dc472e7272ac5278090f01f38e
---

 libavutil/imgutils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index ef0e671..9c8216e 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -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);



More information about the ffmpeg-cvslog mailing list