ffmpeg | branch: master | Martin Vignali <martin.vign...@gmail.com> | Wed Jan 
11 21:47:56 2017 +0100| [31e722e9da0bab02da91eeb7a27a3a458f66aaa5] | committer: 
Michael Niedermayer

libavcodec/psd : add test for channel depth/channel count in bitmap mode

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 libavcodec/psd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/psd.c b/libavcodec/psd.c
index 4d6b0e3..66f2ec2 100644
--- a/libavcodec/psd.c
+++ b/libavcodec/psd.c
@@ -319,6 +319,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 
     switch (s->color_mode) {
     case PSD_BITMAP:
+        if (s->channel_depth != 1 || s->channel_count != 1) {
+            av_log(s->avctx, AV_LOG_ERROR,
+                    "Invalid bitmap file (channel_depth %d, channel_count 
%d)\n",
+                    s->channel_depth, s->channel_count);
+            return AVERROR_INVALIDDATA;
+        }
         s->line_size = s->width + 7 >> 3;
         avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
         break;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to