* [FFmpeg-devel] [PATCH] tiff: add support for one more tag
@ 2022-10-02 18:32 Paul B Mahol
0 siblings, 0 replies; only message in thread
From: Paul B Mahol @ 2022-10-02 18:32 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- 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".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-02 18:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 18:32 [FFmpeg-devel] [PATCH] tiff: add support for one more tag Paul B Mahol
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