avcodec/cfhd: Use the actual count instead of the expected in peak_table()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 12 Aug 2018 22:58:32 +0000 (00:58 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 20 Aug 2018 00:32:41 +0000 (02:32 +0200)
Fixes: out of array access (no testcase)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/cfhd.c

index 1959762..846d334 100644 (file)
@@ -697,7 +697,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
                 goto end;
             }
             if (s->peak.level)
                 goto end;
             }
             if (s->peak.level)
-                peak_table(coeff_data - expected, &s->peak, expected);
+                peak_table(coeff_data - count, &s->peak, count);
             if (s->difference_coding)
                 difference_coding(s->plane[s->channel_num].subband[s->subband_num_actual], highpass_width, highpass_height);
 
             if (s->difference_coding)
                 difference_coding(s->plane[s->channel_num].subband[s->subband_num_actual], highpass_width, highpass_height);