From e70b9b32d5ba84fe3c9a7fe2fae9c9c12b666fd6 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 20 Apr 2014 04:13:43 +0200 Subject: [PATCH] avcodec/exif: do not follow 0 offsets Fixes exif decoding failure of 1295328_300.jpg Reviewed-by; Thilo Borgmann Signed-off-by: Michael Niedermayer --- libavcodec/exif.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/exif.c b/libavcodec/exif.c index 0f3f80c976..a980da2a7b 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);