summaryrefslogtreecommitdiff
path: root/libavcodec/exif.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-20 04:13:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-20 17:02:16 +0200
commite70b9b32d5ba84fe3c9a7fe2fae9c9c12b666fd6 (patch)
tree4cfb9f4694a05bdd1d5b6a983ceb428de5eb96f0 /libavcodec/exif.c
parenta94de50ba02f5c260ca7c571b43fb595c8f951b6 (diff)
downloadffmpeg-e70b9b32d5ba84fe3c9a7fe2fae9c9c12b666fd6.tar.gz
avcodec/exif: do not follow 0 offsets
Fixes exif decoding failure of 1295328_300.jpg Reviewed-by; Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/exif.c')
-rw-r--r--libavcodec/exif.c5
1 files changed, 5 insertions, 0 deletions
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);