Commit 2260c077 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

dvbsubdec: fix division by zero in compute_default_clut

This problem was introduced in commit
4b90dcb8.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit c82b8ef0)
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 5c55f988
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment