On 9/21/2022 4:23 AM, Paul B Mahol wrote:
Patches attached.

[...]

+static av_cold int apac_close(AVCodecContext *avctx)
+{
+    APACContext *s = avctx->priv_data;
+
+    av_freep(&s->bitstream);
+    s->bitstream_size = 0;
+
+    for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) {

for (int ch = 0; ch < FF_ARRAY_ELEMS(s->ch); ch++)

As Andreas mentioned on IRC, this will crash if you try to initialize the decoder by setting more than 2 channels otherwise.

+        ChContext *c = &s->ch[ch];
+
+        av_audio_fifo_free(c->samples);
+    }
+
+    return 0;
+}

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to