[FFmpeg-trac] #9445(avcodec:new): QDM2 wrong samplerate
FFmpeg
trac at avcodec.org
Tue Aug 30 01:08:57 EEST 2022
#9445: QDM2 wrong samplerate
------------------------------------+-----------------------------------
Reporter: cgbug | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: avcodec
Version: git-master | Resolution:
Keywords: qdm2 | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+-----------------------------------
Comment (by Carl Eugen Hoyos):
Should be tested against an original !QuickTime installation
{{{
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 51ca1fb516..8f0c888f59 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1613,7 +1613,7 @@ static av_cold int qdm2_decode_init(AVCodecContext
*avctx)
{
static AVOnce init_static_once = AV_ONCE_INIT;
QDM2Context *s = avctx->priv_data;
- int tmp_val, tmp, size;
+ int tmp_val, tmp, size, sample_rate;
GetByteContext gb;
/* extradata parsing
@@ -1695,7 +1695,9 @@ static av_cold int qdm2_decode_init(AVCodecContext
*avctx)
av_channel_layout_uninit(&avctx->ch_layout);
av_channel_layout_default(&avctx->ch_layout, s->channels);
- avctx->sample_rate = bytestream2_get_be32(&gb);
+ sample_rate = bytestream2_get_be32(&gb);
+ if (avctx->sample_rate <= 0)
+ avctx->sample_rate = sample_rate;
avctx->bit_rate = bytestream2_get_be32(&gb);
s->group_size = bytestream2_get_be32(&gb);
s->fft_size = bytestream2_get_be32(&gb);
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9445#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list