Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/5] avcodec/mjpegdec: Restrict AVID MJPEG to non-SMVJPEG
@ 2022-12-07 19:00 Andreas Rheinhardt
  2022-12-07 19:02 ` [FFmpeg-devel] [PATCH 2/5] avcodec/mjpegdec: Move special SMVJPEG-code to SMVJPEG-only function Andreas Rheinhardt
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2022-12-07 19:00 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

AVID content is not supposed to be SMVJPEG; given that
both these codecs involve manipulating image dimensions
and cropping dimensions, it makes sense to restrict
the AVID codepaths to non-SMVJPEG codecs in order not
to have to think about what if SMVJPEG happens to
have a codec tag indicating AVID.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mjpegdec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 9b7465abe7..28e2839072 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -452,7 +452,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
         if (ret < 0)
             return ret;
 
-        if ((s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') ||
+        if (s->avctx->codec_id != AV_CODEC_ID_SMVJPEG &&
+            (s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') ||
              s->avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) &&
             s->orig_height < height)
             s->avctx->height = AV_CEIL_RSHIFT(s->orig_height, s->avctx->lowres);
@@ -2927,7 +2928,8 @@ the_end:
             return ret;
         }
     }
-    if ((avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') ||
+    if (avctx->codec_id != AV_CODEC_ID_SMVJPEG &&
+        (avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') ||
          avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) &&
         avctx->coded_height > s->orig_height) {
         frame->height   = AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres);
-- 
2.34.1

_______________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2022-12-10 11:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-07 19:00 [FFmpeg-devel] [PATCH 1/5] avcodec/mjpegdec: Restrict AVID MJPEG to non-SMVJPEG Andreas Rheinhardt
2022-12-07 19:02 ` [FFmpeg-devel] [PATCH 2/5] avcodec/mjpegdec: Move special SMVJPEG-code to SMVJPEG-only function Andreas Rheinhardt
2022-12-07 19:02 ` [FFmpeg-devel] [PATCH 3/5] avcodec/mjpegdec: Avoid checks whose results are known at compile-time Andreas Rheinhardt
2022-12-07 19:02 ` [FFmpeg-devel] [PATCH 4/5] avcodec/mjpegdec: Only use receive_frame for SMVJPEG Andreas Rheinhardt
2022-12-07 19:02 ` [FFmpeg-devel] [PATCH 5/5] avcodec/mjpegdec: Move smv_process_frame() to other SMV stuff Andreas Rheinhardt
2022-12-10 10:51 ` [FFmpeg-devel] [PATCH 1/5] avcodec/mjpegdec: Restrict AVID MJPEG to non-SMVJPEG Andreas Rheinhardt
2022-12-10 11:02 ` 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