[FFmpeg-cvslog] tiffdec: use checked reads for tget*()
Michael Niedermayer
git at videolan.org
Fri Nov 9 12:21:58 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 9 12:03:57 2012 +0100| [ce1ebb31a9a0e556a89cd7681082af19fbc1cced] | committer: Michael Niedermayer
tiffdec: use checked reads for tget*()
Fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce1ebb31a9a0e556a89cd7681082af19fbc1cced
---
libavcodec/tiff.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 34dd42d..5d9f801 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -67,26 +67,26 @@ typedef struct TiffContext {
static unsigned tget_short(GetByteContext *gb, int le)
{
- unsigned v = le ? bytestream2_get_le16u(gb) : bytestream2_get_be16u(gb);
+ unsigned v = le ? bytestream2_get_le16(gb) : bytestream2_get_be16(gb);
return v;
}
static unsigned tget_long(GetByteContext *gb, int le)
{
- unsigned v = le ? bytestream2_get_le32u(gb) : bytestream2_get_be32u(gb);
+ unsigned v = le ? bytestream2_get_le32(gb) : bytestream2_get_be32(gb);
return v;
}
static double tget_double(GetByteContext *gb, int le)
{
- av_alias64 i = { .u64 = le ? bytestream2_get_le64u(gb) : bytestream2_get_be64u(gb)};
+ av_alias64 i = { .u64 = le ? bytestream2_get_le64(gb) : bytestream2_get_be64(gb)};
return i.f64;
}
static unsigned tget(GetByteContext *gb, int type, int le)
{
switch (type) {
- case TIFF_BYTE : return bytestream2_get_byteu(gb);
+ case TIFF_BYTE : return bytestream2_get_byte(gb);
case TIFF_SHORT: return tget_short(gb, le);
case TIFF_LONG : return tget_long(gb, le);
default : return UINT_MAX;
More information about the ffmpeg-cvslog
mailing list