X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fbmp.c;h=f545e784b8f50e678ccf700d75d0c5b34a6e8ebe;hb=380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8;hp=e5f7ebb0c533810bc4074f1043892d0e495826da;hpb=b2bed9325dbd6be0da1d91ffed3f513c40274fd2;p=ffmpeg diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index e5f7ebb0c53..f545e784b8f 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "avcodec.h" #include "bytestream.h" #include "bmp.h" @@ -57,7 +59,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, fsize = bytestream_get_le32(&buf); if (buf_size < fsize) { - av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d), trying to decode anyway\n", + av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %u), trying to decode anyway\n", buf_size, fsize); fsize = buf_size; } @@ -68,7 +70,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, hsize = bytestream_get_le32(&buf); /* header size */ ihsize = bytestream_get_le32(&buf); /* more header size */ if (ihsize + 14 > hsize) { - av_log(avctx, AV_LOG_ERROR, "invalid header size %d\n", hsize); + av_log(avctx, AV_LOG_ERROR, "invalid header size %u\n", hsize); return AVERROR_INVALIDDATA; } @@ -77,7 +79,8 @@ static int bmp_decode_frame(AVCodecContext *avctx, fsize = buf_size - 2; if (fsize <= hsize) { - av_log(avctx, AV_LOG_ERROR, "declared file size is less than header size (%d < %d)\n", + av_log(avctx, AV_LOG_ERROR, + "Declared file size is less than header size (%u < %u)\n", fsize, hsize); return AVERROR_INVALIDDATA; } @@ -163,7 +166,9 @@ static int bmp_decode_frame(AVCodecContext *avctx, else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F) avctx->pix_fmt = AV_PIX_FMT_RGB444; else { - av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]); + av_log(avctx, AV_LOG_ERROR, + "Unknown bitfields %0"PRIX32" %0"PRIX32" %0"PRIX32"\n", + rgb[0], rgb[1], rgb[2]); return AVERROR(EINVAL); } } @@ -179,12 +184,13 @@ static int bmp_decode_frame(AVCodecContext *avctx, if (hsize - ihsize - 14 > 0) { avctx->pix_fmt = AV_PIX_FMT_PAL8; } else { - av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1< (1 << depth)) { - av_log(avctx, AV_LOG_ERROR, "Incorrect number of colors - %X for bitdepth %d\n", t, depth); + av_log(avctx, AV_LOG_ERROR, + "Incorrect number of colors - %X for bitdepth %u\n", + t, depth); } else if (t) { colors = t; } @@ -345,5 +353,5 @@ AVCodec ff_bmp_decoder = { .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_BMP, .decode = bmp_decode_frame, - .capabilities = CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DR1, };