[FFmpeg-cvslog] avcodec/prosumer: Only scan as many elements as matter in fill_elements()

Michael Niedermayer git at videolan.org
Mon Sep 24 01:59:34 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 22 18:14:02 2018 +0200| [3c9ebcbc4dceef385e20e76704bf3c2e370b9368] | committer: Michael Niedermayer

avcodec/prosumer: Only scan as many elements as matter in fill_elements()

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c9ebcbc4dceef385e20e76704bf3c2e370b9368
---

 libavcodec/prosumer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c
index 9e8a94d4db..b7e417aa0b 100644
--- a/libavcodec/prosumer.c
+++ b/libavcodec/prosumer.c
@@ -279,12 +279,12 @@ static const uint16_t table[] = {
     0x0001
 };
 
-static void fill_elements(uint32_t idx, uint32_t shift, int size, uint32_t *e0, uint32_t *e1)
+static void fill_elements(uint32_t idx, uint32_t shift, uint32_t *e0, uint32_t *e1)
 {
     uint32_t b, h = idx << (32 - shift);
 
     for (int j = 0; j < 2; j++) {
-        for (int i = 0; i < size; i++) {
+        for (int i = 0; i < 43; i++) {
             b = 4 * TB(i);
             if (shift >= b && ((h & (0xFFF00000u << (12 - b))) >> 20) == table[2 * i + 1]) {
                 if (table[2 * i] >> 8 == 0x80u) {
@@ -322,7 +322,7 @@ static void fill_lut(uint32_t *lut)
                 uint32_t f = 0xFFFFFFFFu;
                 c &= 0xFFFFFFu;
                 if ((c & 0xFF00u) != 0x8000u)
-                    fill_elements(j, d, 365, &c, &f);
+                    fill_elements(j, d, &c, &f);
                 lut[2 * a + 2 * j] = c;
                 lut[2 * a + 2 * j + 1] = f;
             }



More information about the ffmpeg-cvslog mailing list