bmp: cosmetics, reformat
This commit is contained in:
@@ -25,7 +25,8 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "msrledec.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;
|
BMPContext *s = avctx->priv_data;
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&s->picture);
|
avcodec_get_frame_defaults(&s->picture);
|
||||||
@@ -110,7 +111,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
|
|||||||
return -1;
|
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");
|
av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -122,7 +124,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
|
|||||||
else
|
else
|
||||||
comp = BMP_RGB;
|
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);
|
av_log(avctx, AV_LOG_ERROR, "BMP coding %d not supported\n", comp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -253,7 +256,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buf = buf0 + 14 + ihsize; //palette location
|
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++)
|
for (i = 0; i < colors; i++)
|
||||||
((uint32_t*)p->data[1])[i] = bytestream_get_le24(&buf);
|
((uint32_t*)p->data[1])[i] = bytestream_get_le24(&buf);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user