From: Paul B Mahol <onemda@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] tiff: add support for one more tag
Date: Sun, 2 Oct 2022 20:32:18 +0200
Message-ID: <CAPYw7P6bAU-gnEUcmnzW1e=QsL6HygmDTmFNZj1rTbFphGMtsw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 16 bytes --]
Patch attached.
[-- Attachment #2: 0001-avcodec-tiff-add-support-for-one-more-tag.patch --]
[-- Type: text/x-patch, Size: 1954 bytes --]
From c3dc0b0bf8fe84692ae0c877c6f33880ad7992c5 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sun, 2 Oct 2022 20:32:34 +0200
Subject: [PATCH] avcodec/tiff: add support for one more tag
Also be less strict about tag order.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavcodec/tiff.c | 9 +++++++--
libavcodec/tiff.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index fd9db18c0b..0a8df6a788 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1264,7 +1264,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
if (ret < 0) {
goto end;
}
- if (tag <= s->last_tag)
+ if (s->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT && tag <= s->last_tag)
return AVERROR_INVALIDDATA;
// We ignore TIFF_STRIP_SIZE as it is sometimes in the logic but wrong order around TIFF_STRIP_OFFS
@@ -1783,7 +1783,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
break;
case DNG_AS_SHOT_NEUTRAL:
- if (type != TIFF_RATIONAL)
+ if (type != TIFF_RATIONAL &&
+ type != TIFF_SHORT)
break;
for (int i = 0; i < 3; i++) {
@@ -1845,6 +1846,10 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
}
break;
+ case DNG_PRIVATE_DATA:
+ for (int i = 0; i < count; i++)
+ ff_tget(&s->gb, type, s->le);
+ break;
case CINEMADNG_TIME_CODES:
case CINEMADNG_FRAME_RATE:
case CINEMADNG_T_STOP:
diff --git a/libavcodec/tiff.h b/libavcodec/tiff.h
index e67c59abad..e491d8ea28 100644
--- a/libavcodec/tiff.h
+++ b/libavcodec/tiff.h
@@ -113,6 +113,7 @@ enum DngTags {
DNG_ANALOG_BALANCE = 0xC627,
DNG_AS_SHOT_NEUTRAL = 0xC628,
DNG_AS_SHOT_WHITE_XY = 0xC629,
+ DNG_PRIVATE_DATA = 0xC634,
};
/** list of CinemaDNG tags */
--
2.37.2
[-- Attachment #3: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2022-10-02 18:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPYw7P6bAU-gnEUcmnzW1e=QsL6HygmDTmFNZj1rTbFphGMtsw@mail.gmail.com' \
--to=onemda@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git