[FFmpeg-cvslog] avcodec/exif: do not follow 0 offsets

Michael Niedermayer git at videolan.org
Sun Apr 20 17:21:42 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 20 04:13:43 2014 +0200| [e70b9b32d5ba84fe3c9a7fe2fae9c9c12b666fd6] | committer: Michael Niedermayer

avcodec/exif: do not follow 0 offsets

Fixes exif decoding failure of 1295328_300.jpg

Reviewed-by; Thilo Borgmann <thilo.borgmann at mail.de>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/exif.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/exif.c b/libavcodec/exif.c
index 0f3f80c..a980da2 100644
--- a/libavcodec/exif.c
+++ b/libavcodec/exif.c
@@ -78,6 +78,11 @@ static int exif_decode_tag(AVCodecContext *avctx, GetByteContext *gbytes, int le
 
     ff_tread_tag(gbytes, le, &id, &type, &count, &cur_pos);
 
+    if (!bytestream2_tell(gbytes)) {
+        bytestream2_seek(gbytes, cur_pos, SEEK_SET);
+        return 0;
+    }
+
     // read count values and add it metadata
     // store metadata or proceed with next IFD
     ret = ff_tis_ifd(id);



More information about the ffmpeg-cvslog mailing list