You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/vorbisdec: use av_freep(), do not leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -196,7 +196,7 @@ static void vorbis_free(vorbis_context *vc)
|
|||||||
|
|
||||||
if (vc->residues)
|
if (vc->residues)
|
||||||
for (i = 0; i < vc->residue_count; i++)
|
for (i = 0; i < vc->residue_count; i++)
|
||||||
av_free(vc->residues[i].classifs);
|
av_freep(&vc->residues[i].classifs);
|
||||||
av_freep(&vc->residues);
|
av_freep(&vc->residues);
|
||||||
av_freep(&vc->modes);
|
av_freep(&vc->modes);
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ static void vorbis_free(vorbis_context *vc)
|
|||||||
|
|
||||||
if (vc->codebooks)
|
if (vc->codebooks)
|
||||||
for (i = 0; i < vc->codebook_count; ++i) {
|
for (i = 0; i < vc->codebook_count; ++i) {
|
||||||
av_free(vc->codebooks[i].codevectors);
|
av_freep(&vc->codebooks[i].codevectors);
|
||||||
ff_free_vlc(&vc->codebooks[i].vlc);
|
ff_free_vlc(&vc->codebooks[i].vlc);
|
||||||
}
|
}
|
||||||
av_freep(&vc->codebooks);
|
av_freep(&vc->codebooks);
|
||||||
@@ -213,21 +213,21 @@ static void vorbis_free(vorbis_context *vc)
|
|||||||
if (vc->floors)
|
if (vc->floors)
|
||||||
for (i = 0; i < vc->floor_count; ++i) {
|
for (i = 0; i < vc->floor_count; ++i) {
|
||||||
if (vc->floors[i].floor_type == 0) {
|
if (vc->floors[i].floor_type == 0) {
|
||||||
av_free(vc->floors[i].data.t0.map[0]);
|
av_freep(&vc->floors[i].data.t0.map[0]);
|
||||||
av_free(vc->floors[i].data.t0.map[1]);
|
av_freep(&vc->floors[i].data.t0.map[1]);
|
||||||
av_free(vc->floors[i].data.t0.book_list);
|
av_freep(&vc->floors[i].data.t0.book_list);
|
||||||
av_free(vc->floors[i].data.t0.lsp);
|
av_freep(&vc->floors[i].data.t0.lsp);
|
||||||
} else {
|
} else {
|
||||||
av_free(vc->floors[i].data.t1.list);
|
av_freep(&vc->floors[i].data.t1.list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
av_freep(&vc->floors);
|
av_freep(&vc->floors);
|
||||||
|
|
||||||
if (vc->mappings)
|
if (vc->mappings)
|
||||||
for (i = 0; i < vc->mapping_count; ++i) {
|
for (i = 0; i < vc->mapping_count; ++i) {
|
||||||
av_free(vc->mappings[i].magnitude);
|
av_freep(&vc->mappings[i].magnitude);
|
||||||
av_free(vc->mappings[i].angle);
|
av_freep(&vc->mappings[i].angle);
|
||||||
av_free(vc->mappings[i].mux);
|
av_freep(&vc->mappings[i].mux);
|
||||||
}
|
}
|
||||||
av_freep(&vc->mappings);
|
av_freep(&vc->mappings);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user