sab_diamond_search: add assert to double check the minima_count
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 4 Nov 2012 03:46:53 +0000 (04:46 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 4 Nov 2012 12:00:20 +0000 (13:00 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/motion_est_template.c

index 07bfc00..2b1c6e1 100644 (file)
@@ -688,6 +688,8 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
     LOAD_COMMON2
     unsigned map_generation = c->map_generation;
 
+    av_assert1(minima_count <= MAX_SAB_SIZE);
+
     cmpf= s->dsp.me_cmp[size];
     chroma_cmpf= s->dsp.me_cmp[size+1];