1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

bmp: cosmetics, reformat

This commit is contained in:
Anton Khirnov 2012-11-15 09:23:55 +01:00
parent 4a9f7d2bf9
commit 3eab600752

View File

@ -25,7 +25,8 @@
#include "internal.h"
#include "msrledec.h"
static av_cold int bmp_decode_init(AVCodecContext *avctx){
static av_cold int bmp_decode_init(AVCodecContext *avctx)
{
BMPContext *s = avctx->priv_data;
avcodec_get_frame_defaults(&s->picture);
@ -110,7 +111,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
return -1;
}
if(bytestream_get_le16(&buf) != 1){ /* planes */
/* planes */
if (bytestream_get_le16(&buf) != 1) {
av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n");
return -1;
}
@ -122,7 +124,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
else
comp = BMP_RGB;
if(comp != BMP_RGB && comp != BMP_BITFIELDS && comp != BMP_RLE4 && comp != BMP_RLE8){
if (comp != BMP_RGB && comp != BMP_BITFIELDS && comp != BMP_RLE4 &&
comp != BMP_RLE8) {
av_log(avctx, AV_LOG_ERROR, "BMP coding %d not supported\n", comp);
return -1;
}
@ -253,7 +256,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
}
}
buf = buf0 + 14 + ihsize; //palette location
if((hsize-ihsize-14) < (colors << 2)){ // OS/2 bitmap, 3 bytes per palette entry
// OS/2 bitmap, 3 bytes per palette entry
if ((hsize-ihsize-14) < (colors << 2)) {
for (i = 0; i < colors; i++)
((uint32_t*)p->data[1])[i] = bytestream_get_le24(&buf);
} else {