[FFmpeg-cvslog] avcodec/tiff: move bpp check to after "end:"

Michael Niedermayer git at videolan.org
Thu Mar 12 00:52:55 CET 2015


ffmpeg | branch: release/0.7 | Michael Niedermayer <michaelni at gmx.at> | Sun Mar  8 23:27:43 2015 +0100| [5333edcc869181649d7f9d6cdde9f975531c0b8c] | committer: Michael Niedermayer

avcodec/tiff: move bpp check to after "end:"

This ensures that all current and future code-pathes get bpp checked

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d5e9fc782150d4596c72440a0aa02b7f4f1254b1)

Conflicts:

	libavcodec/tiff.c

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

 libavcodec/tiff.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index d26135e..21588e7 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -498,6 +498,13 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
     default:
         av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n", tag, tag);
     }
+    if (s->bpp > 64U) {
+        av_log(s->avctx, AV_LOG_ERROR,
+                "This format is not supported (bpp=%d, %d components)\n",
+                s->bpp, count);
+        s->bpp = 0;
+        return AVERROR_INVALIDDATA;
+    }
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list