[FFmpeg-cvslog] pam: Reject 64bpp rgba.

ami_stuff git at videolan.org
Fri Jan 6 01:27:06 CET 2012


ffmpeg | branch: master | ami_stuff <ami_stuff at o2.pl> | Fri Jan  6 01:25:54 2012 +0100| [febf75f3d2e4335652e6e40ef3427ec019d45aa8] | committer: Carl Eugen Hoyos

pam: Reject 64bpp rgba.

Fixes ticket #883

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

 libavcodec/pnm.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 791829b..ac451ca 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -125,7 +125,12 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
                 avctx->pix_fmt = PIX_FMT_RGB48BE;
             }
         } else if (depth == 4) {
-            avctx->pix_fmt = PIX_FMT_RGB32;
+            if (maxval < 256) {
+                avctx->pix_fmt = PIX_FMT_RGB32;
+            } else {
+                av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth\n");
+                return -1;
+            }
         } else {
             return -1;
         }



More information about the ffmpeg-cvslog mailing list