summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvbsubdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index e9f4765b15..bf3b1a1019 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -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));