Commit 721c916d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/snow: Free all planes and bands independent of the last count

Fixes memleak
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8f4cbf94
......@@ -718,8 +718,8 @@ av_cold void ff_snow_common_end(SnowContext *s)
av_frame_free(&s->last_picture[i]);
}
for(plane_index=0; plane_index < s->nb_planes; plane_index++){
for(level=s->spatial_decomposition_count-1; level>=0; level--){
for(plane_index=0; plane_index < MAX_PLANES; plane_index++){
for(level=MAX_DECOMPOSITIONS-1; level>=0; level--){
for(orientation=level ? 1 : 0; orientation<4; orientation++){
SubBand *b= &s->plane[plane_index].band[level][orientation];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment