Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/bmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index ec4c467049..458fd0c768 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -248,6 +248,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
} else if (t) {
colors = t;
}
+ } else {
+ colors = FFMIN(256, (hsize-ihsize-14) / 3);
}
buf = buf0 + 14 + ihsize; //palette location
// OS/2 bitmap, 3 bytes per palette entry