diff mbox

[FFmpeg-devel,6/6] avcodec/cfhd: Use the actual count instead of the expected in peak_table()

Message ID 20180813002423.10292-6-michael@niedermayer.cc
State Accepted
Commit 77429b4217bd2366c5f05479086b3f9613d640ee
Headers show

Commit Message

Michael Niedermayer Aug. 13, 2018, 12:24 a.m. UTC
Fixes: out of array access (no testcase)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/cfhd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Aug. 19, 2018, 10:35 p.m. UTC | #1
On Mon, Aug 13, 2018 at 02:24:23AM +0200, Michael Niedermayer wrote:
> Fixes: out of array access (no testcase)
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/cfhd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox

Patch

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 1959762f0e..846d334b9b 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -697,7 +697,7 @@  static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
                 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);