mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
dvbsubdec: fix division by zero in compute_default_clut
This problem was introduced in commit 4b90dcb8493552c17a811c8b1e6538dae4061f9d. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit c82b8ef0e4f226423ddd644bfe37e6a15d070924) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
5c55f9881e
commit
2260c0776a
@ -810,7 +810,7 @@ static void compute_default_clut(AVPicture *frame, 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(frame->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));
|
||||
|
Loading…
x
Reference in New Issue
Block a user