Browse Source

dvbsubdec: fix division by zero in compute_default_clut

This problem was introduced in commit
4b90dcb849.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit c82b8ef0e4)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
tags/n3.1.6
Andreas Cadhalpun 9 years ago
parent
commit
5c2e26275c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/dvbsubdec.c

+ 1
- 1
libavcodec/dvbsubdec.c View File

@@ -810,7 +810,7 @@ static void compute_default_clut(AVSubtitleRect *rect, int w, int h)
list_inv[ i ] = bestv;
}

count = i - 1;
count = FFMAX(i - 1, 1);
for (i--; i>=0; i--) {
int v = i*255/count;
AV_WN32(rect->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));


Loading…
Cancel
Save