avcodec/snow: Initialize spatial_decomposition_count to a valid value
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Feb 2015 20:18:13 +0000 (21:18 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Feb 2015 20:30:08 +0000 (21:30 +0100)
Fixes undefined behavior
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/snow.c

index 07ad854..101c8f8 100644 (file)
@@ -434,6 +434,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
 
     s->avctx= avctx;
     s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe
+    s->spatial_decomposition_count = 1;
 
     ff_me_cmp_init(&s->mecc, avctx);
     ff_hpeldsp_init(&s->hdsp, avctx->flags);