summaryrefslogtreecommitdiff
path: root/libavcodec/dxtory.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2014-03-13 12:13:33 +0100
committerDiego Biurrun <diego@biurrun.de>2014-03-22 14:08:20 +0100
commitcc8163e1a3601a56f722a4720516e860bf1c6198 (patch)
treed024d6a6300f2c013910239746ede9a97971518a /libavcodec/dxtory.c
parent7513234bdd93f80593bfee3eb2da8c8f0d3992da (diff)
avcodec: more correct printf specifiers
Diffstat (limited to 'libavcodec/dxtory.c')
-rw-r--r--libavcodec/dxtory.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c
index 5cb7fae33e..662cd9f89d 100644
--- a/libavcodec/dxtory.c
+++ b/libavcodec/dxtory.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "bytestream.h"
@@ -269,18 +271,18 @@ static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
slice_size = bytestream2_get_le32(&gb);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
@@ -350,18 +352,19 @@ static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
slice_size = bytestream2_get_le32(&gb);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n",
+ slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
@@ -448,18 +451,18 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
slice_height = (next_y & ~3) - (cur_y & ~3);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
@@ -552,18 +555,18 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
slice_height = (next_y & ~1) - (cur_y & ~1);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
@@ -645,18 +648,18 @@ static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic,
slice_size = bytestream2_get_le32(&gb);
if (slice_size > src_size - off) {
av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %d (only %d bytes left)\n",
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
slice_size, src_size - off);
return AVERROR_INVALIDDATA;
}
if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
return AVERROR_INVALIDDATA;
}
if (AV_RL32(src + off) != slice_size - 16) {
av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %d instead of %d\n",
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
AV_RL32(src + off), slice_size - 16);
}
init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
@@ -728,7 +731,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ret = dxtory_decode_v2_565(avctx, pic, src + 16, avpkt->size - 16, 0);
break;
default:
- avpriv_request_sample(avctx, "Frame header %X", AV_RB32(src));
+ avpriv_request_sample(avctx, "Frame header %"PRIX32, AV_RB32(src));
return AVERROR_PATCHWELCOME;
}