From: michaelni via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: michaelni <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] avcodec/snowdec: fix mconly (PR #21792)
Date: Thu, 19 Feb 2026 02:32:43 -0000
Message-ID: <177146836359.25.5020729213642865069@29965ddac10e> (raw)
PR #21792 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21792
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21792.patch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>From 30ca22ed8bd12488fd2becc7aefe1970b0d2845a Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu, 19 Feb 2026 03:19:34 +0100
Subject: [PATCH] avcodec/snowdec: fix mconly
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/snow.c | 4 ++--
libavcodec/snowdec.c | 9 ++++-----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 006d84d8ce..0fffc25424 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -541,8 +541,8 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
if(!s->scratchbuf) {
int emu_buf_size;
- emu_buf_size = FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1);
- if (!FF_ALLOCZ_TYPED_ARRAY(s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * 7 * MB_SIZE) ||
+ emu_buf_size = FFMAX(s->current_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1);
+ if (!FF_ALLOCZ_TYPED_ARRAY(s->scratchbuf, FFMAX(s->current_picture->linesize[0], 2*avctx->width+256) * 7 * MB_SIZE) ||
!FF_ALLOCZ_TYPED_ARRAY(s->emu_edge_buffer, emu_buf_size))
return AVERROR(ENOMEM);
}
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index c16e824c73..752cb4363a 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -605,14 +605,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
if ((res = decode_header(s)) < 0)
return res;
- if (!s->mconly_picture->data[0]) {
+ if (avctx->debug & 2048) {
+ av_frame_unref(s->mconly_picture);
res = ff_get_buffer(avctx, s->mconly_picture, AV_GET_BUFFER_FLAG_REF);
if (res < 0)
return res;
- }
- if (s->mconly_picture->format != avctx->pix_fmt) {
- av_log(avctx, AV_LOG_ERROR, "pixel format changed\n");
- return AVERROR_INVALIDDATA;
+
+ av_assert0 (s->mconly_picture->format == avctx->pix_fmt);
}
if ((res=ff_snow_common_init_after_header(avctx)) < 0)
--
2.52.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2026-02-19 2:33 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=177146836359.25.5020729213642865069@29965ddac10e \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@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