diff mbox series

[FFmpeg-devel] avcodec/flac: critical fix

Message ID CAPYw7P7tjX1sVgBTC76UHKT2Zv4dvTLmzBQZPs6Xrm=P_qmNWA@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] avcodec/flac: critical fix | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Paul B Mahol Sept. 4, 2022, 6:54 p.m. UTC
Another critical fix for decoder.

Comments

Leo Izen Sept. 4, 2022, 7:11 p.m. UTC | #1
On 9/4/22 14:54, Paul B Mahol wrote:
> Another critical fix for decoder.
> 
> 
> _______________________________________________
> 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".

I tested this, I can confirm it fixes #9270.

I'm not familiar with the copyright status on the given sample, would it 
make sense to add a fate test to this to prevent this kind of regression 
in the future?

- Leo Izen (thebombzen)
diff mbox series

Patch

From e61c05f721eee756739ba7cd864486ea9704b3c9 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sun, 4 Sep 2022 20:50:16 +0200
Subject: [PATCH] avcodec/flac: smallest frame is 10 bytes

Fixes #9270

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/flac.h    | 2 +-
 libavcodec/flacdec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/flac.h b/libavcodec/flac.h
index f118dbbff3..00e631ed20 100644
--- a/libavcodec/flac.h
+++ b/libavcodec/flac.h
@@ -33,7 +33,7 @@ 
 #define FLAC_MAX_CHANNELS       8
 #define FLAC_MIN_BLOCKSIZE     16
 #define FLAC_MAX_BLOCKSIZE  65535
-#define FLAC_MIN_FRAME_SIZE    11
+#define FLAC_MIN_FRAME_SIZE    10
 
 enum {
     FLAC_CHMODE_INDEPENDENT = 0,
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 075d76bc8a..5b8547a98f 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -577,7 +577,7 @@  static int flac_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     /* check that there is at least the smallest decodable amount of data.
        this amount corresponds to the smallest valid FLAC frame possible.
-       FF F8 69 02 00 00 9A 00 00 34 46 */
+       FF F8 69 02 00 00 9A 00 00 34 */
     if (buf_size < FLAC_MIN_FRAME_SIZE)
         return buf_size;
 
-- 
2.37.2