diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index 8130b74..11858c7 100644
|
a
|
b
|
static int encode_dvd_subtitles(AVCodecContext *avctx,
|
| 383 | 383 | qq = outbuf; |
| 384 | 384 | bytestream_put_be16(&qq, q - outbuf); |
| 385 | 385 | |
| 386 | | av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%td\n", q - outbuf); |
| | 386 | av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%"PTRDIFF_SPECIFIER"\n", q - outbuf); |
| 387 | 387 | ret = q - outbuf; |
| 388 | 388 | |
| 389 | 389 | fail: |
diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c
index ba1f060..87af368 100644
|
a
|
b
|
static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
| 599 | 599 | if ( av_fifo_space(fpc->fifo_buf) < read_end - read_start |
| 600 | 600 | && av_fifo_realloc2(fpc->fifo_buf, (read_end - read_start) + 2*av_fifo_size(fpc->fifo_buf)) < 0) { |
| 601 | 601 | av_log(avctx, AV_LOG_ERROR, |
| 602 | | "couldn't reallocate buffer of size %td\n", |
| | 602 | "couldn't reallocate buffer of size %"PTRDIFF_SPECIFIER"\n", |
| 603 | 603 | (read_end - read_start) + av_fifo_size(fpc->fifo_buf)); |
| 604 | 604 | goto handle_error; |
| 605 | 605 | } |
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index ed3c8fe..48f2381 100644
|
a
|
b
|
static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
| 2407 | 2407 | return 0; |
| 2408 | 2408 | } |
| 2409 | 2409 | if (h->cabac.bytestream > h->cabac.bytestream_end + 2 ) |
| 2410 | | av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %td\n", h->cabac.bytestream_end - h->cabac.bytestream); |
| | 2410 | av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %"PTRDIFF_SPECIFIER"\n", h->cabac.bytestream_end - h->cabac.bytestream); |
| 2411 | 2411 | if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) { |
| 2412 | 2412 | av_log(h->avctx, AV_LOG_ERROR, |
| 2413 | | "error while decoding MB %d %d, bytestream %td\n", |
| | 2413 | "error while decoding MB %d %d, bytestream %"PTRDIFF_SPECIFIER"\n", |
| 2414 | 2414 | h->mb_x, h->mb_y, |
| 2415 | 2415 | h->cabac.bytestream_end - h->cabac.bytestream); |
| 2416 | 2416 | er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x, |
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 5ae540e..fbfb7d1 100644
|
a
|
b
|
static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
|
| 782 | 782 | return ret; |
| 783 | 783 | if (ret > sizeof(cblk->data)) { |
| 784 | 784 | avpriv_request_sample(s->avctx, |
| 785 | | "Block with lengthinc greater than %zu", |
| | 785 | "Block with lengthinc greater than %"SIZE_SPECIFIER"", |
| 786 | 786 | sizeof(cblk->data)); |
| 787 | 787 | return AVERROR_PATCHWELCOME; |
| 788 | 788 | } |
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 869c8fe..bc0cf96 100644
|
a
|
b
|
static av_cold void dump_enc_cfg(AVCodecContext *avctx,
|
| 158 | 158 | width, "g_lag_in_frames:", cfg->g_lag_in_frames); |
| 159 | 159 | av_log(avctx, level, "rate control settings\n" |
| 160 | 160 | " %*s%u\n %*s%u\n %*s%u\n %*s%u\n" |
| 161 | | " %*s%d\n %*s%p(%zu)\n %*s%u\n", |
| | 161 | " %*s%d\n %*s%p(%"SIZE_SPECIFIER")\n %*s%u\n", |
| 162 | 162 | width, "rc_dropframe_thresh:", cfg->rc_dropframe_thresh, |
| 163 | 163 | width, "rc_resize_allowed:", cfg->rc_resize_allowed, |
| 164 | 164 | width, "rc_resize_up_thresh:", cfg->rc_resize_up_thresh, |
| … |
… |
static av_cold int vpx_init(AVCodecContext *avctx,
|
| 373 | 373 | ctx->twopass_stats.buf = av_malloc(ctx->twopass_stats.sz); |
| 374 | 374 | if (!ctx->twopass_stats.buf) { |
| 375 | 375 | av_log(avctx, AV_LOG_ERROR, |
| 376 | | "Stat buffer alloc (%zu bytes) failed\n", |
| | 376 | "Stat buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", |
| 377 | 377 | ctx->twopass_stats.sz); |
| 378 | 378 | return AVERROR(ENOMEM); |
| 379 | 379 | } |
| … |
… |
static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
|
| 616 | 616 | |
| 617 | 617 | if (!cx_frame->buf) { |
| 618 | 618 | av_log(avctx, AV_LOG_ERROR, |
| 619 | | "Data buffer alloc (%zu bytes) failed\n", |
| | 619 | "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", |
| 620 | 620 | cx_frame->sz); |
| 621 | 621 | av_free(cx_frame); |
| 622 | 622 | return AVERROR(ENOMEM); |
| … |
… |
static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
|
| 626 | 626 | cx_frame->buf_alpha = av_malloc(cx_frame->sz_alpha); |
| 627 | 627 | if (!cx_frame->buf_alpha) { |
| 628 | 628 | av_log(avctx, AV_LOG_ERROR, |
| 629 | | "Data buffer alloc (%zu bytes) failed\n", |
| | 629 | "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", |
| 630 | 630 | cx_frame->sz_alpha); |
| 631 | 631 | av_free(cx_frame); |
| 632 | 632 | return AVERROR(ENOMEM); |
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 9f7d08f..d6e0fb5 100644
|
a
|
b
|
int ff_mjpeg_find_marker(MJpegDecodeContext *s,
|
| 1815 | 1815 | memset(s->buffer + *unescaped_buf_size, 0, |
| 1816 | 1816 | FF_INPUT_BUFFER_PADDING_SIZE); |
| 1817 | 1817 | |
| 1818 | | av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %td bytes\n", |
| | 1818 | av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %"PTRDIFF_SPECIFIER" bytes\n", |
| 1819 | 1819 | (buf_end - *buf_ptr) - (dst - s->buffer)); |
| 1820 | 1820 | } else if (start_code == SOS && s->ls) { |
| 1821 | 1821 | const uint8_t *src = *buf_ptr; |
| … |
… |
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
| 1898 | 1898 | start_code, unescaped_buf_size, buf_size); |
| 1899 | 1899 | return AVERROR_INVALIDDATA; |
| 1900 | 1900 | } |
| 1901 | | av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%td\n", |
| | 1901 | av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n", |
| 1902 | 1902 | start_code, buf_end - buf_ptr); |
| 1903 | 1903 | |
| 1904 | 1904 | ret = init_get_bits8(&s->gb, unescaped_buf_ptr, unescaped_buf_size); |
| … |
… |
the_end:
|
| 2183 | 2183 | av_dict_copy(avpriv_frame_get_metadatap(data), s->exif_metadata, 0); |
| 2184 | 2184 | av_dict_free(&s->exif_metadata); |
| 2185 | 2185 | |
| 2186 | | av_log(avctx, AV_LOG_DEBUG, "decode frame unused %td bytes\n", |
| | 2186 | av_log(avctx, AV_LOG_DEBUG, "decode frame unused %"PTRDIFF_SPECIFIER" bytes\n", |
| 2187 | 2187 | buf_end - buf_ptr); |
| 2188 | 2188 | // return buf_end - buf_ptr; |
| 2189 | 2189 | return buf_ptr - buf; |
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index b99af17..2071298 100644
|
a
|
b
|
static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
|
| 2391 | 2391 | input_size = buf_end - buf_ptr; |
| 2392 | 2392 | |
| 2393 | 2393 | if (avctx->debug & FF_DEBUG_STARTCODE) |
| 2394 | | av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %td left %d\n", |
| | 2394 | av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %"PTRDIFF_SPECIFIER" left %d\n", |
| 2395 | 2395 | start_code, buf_ptr - buf, input_size); |
| 2396 | 2396 | |
| 2397 | 2397 | /* prepare data for next start code */ |
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 79b2be6..83976d0 100644
|
a
|
b
|
static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
|
| 1045 | 1045 | if (s->linesize & (STRIDE_ALIGN-1)) |
| 1046 | 1046 | direct = 0; |
| 1047 | 1047 | |
| 1048 | | av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0], |
| | 1048 | av_dlog(s->avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0], |
| 1049 | 1049 | pic_arg->linesize[1], s->linesize, s->uvlinesize); |
| 1050 | 1050 | |
| 1051 | 1051 | if (direct) { |
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index b1816b4..466c1a9 100644
|
a
|
b
|
static int wma_decode_superframe(AVCodecContext *avctx, void *data,
|
| 927 | 927 | samples_offset += s->frame_len; |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | | av_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n", |
| | 930 | av_dlog(s->avctx, "%d %d %d %d outbytes:%"PTRDIFF_SPECIFIER" eaten:%d\n", |
| 931 | 931 | s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len, |
| 932 | 932 | (int8_t *)samples - (int8_t *)data, avctx->block_align); |
| 933 | 933 | |
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 71e8287..21a9e35 100644
|
a
|
b
|
static int zmbv_decode_xor_8(ZmbvContext *c)
|
| 145 | 145 | prev += c->width * c->bh; |
| 146 | 146 | } |
| 147 | 147 | if (src - c->decomp_buf != c->decomp_len) |
| 148 | | av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n", |
| | 148 | av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", |
| 149 | 149 | src-c->decomp_buf, c->decomp_len); |
| 150 | 150 | return 0; |
| 151 | 151 | } |
| … |
… |
static int zmbv_decode_xor_16(ZmbvContext *c)
|
| 219 | 219 | prev += c->width * c->bh; |
| 220 | 220 | } |
| 221 | 221 | if (src - c->decomp_buf != c->decomp_len) |
| 222 | | av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n", |
| | 222 | av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", |
| 223 | 223 | src-c->decomp_buf, c->decomp_len); |
| 224 | 224 | return 0; |
| 225 | 225 | } |
| … |
… |
static int zmbv_decode_xor_32(ZmbvContext *c)
|
| 377 | 377 | prev += c->width * c->bh; |
| 378 | 378 | } |
| 379 | 379 | if (src - c->decomp_buf != c->decomp_len) |
| 380 | | av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n", |
| | 380 | av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", |
| 381 | 381 | src-c->decomp_buf, c->decomp_len); |
| 382 | 382 | return 0; |
| 383 | 383 | } |
diff --git a/libavformat/ape.c b/libavformat/ape.c
index b677ba9..d5a786a 100644
|
a
|
b
|
static int ape_read_header(AVFormatContext * s)
|
| 264 | 264 | } |
| 265 | 265 | if (ape->seektablelength / sizeof(*ape->seektable) < ape->totalframes) { |
| 266 | 266 | av_log(s, AV_LOG_ERROR, |
| 267 | | "Number of seek entries is less than number of frames: %zu vs. %"PRIu32"\n", |
| | 267 | "Number of seek entries is less than number of frames: %"SIZE_SPECIFIER" vs. %"PRIu32"\n", |
| 268 | 268 | ape->seektablelength / sizeof(*ape->seektable), ape->totalframes); |
| 269 | 269 | return AVERROR_INVALIDDATA; |
| 270 | 270 | } |
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 8a8989b..e813ca3 100644
|
a
|
b
|
static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen,
|
| 327 | 327 | |
| 328 | 328 | geob_data = av_mallocz(sizeof(ID3v2ExtraMetaGEOB)); |
| 329 | 329 | if (!geob_data) { |
| 330 | | av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n", |
| | 330 | av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n", |
| 331 | 331 | sizeof(ID3v2ExtraMetaGEOB)); |
| 332 | 332 | return; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | new_extra = av_mallocz(sizeof(ID3v2ExtraMeta)); |
| 336 | 336 | if (!new_extra) { |
| 337 | | av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n", |
| | 337 | av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n", |
| 338 | 338 | sizeof(ID3v2ExtraMeta)); |
| 339 | 339 | goto fail; |
| 340 | 340 | } |
diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index 482ece4..dac5d9f 100644
|
a
|
b
|
static int read_data_packet(MMSHContext *mmsh, const int len)
|
| 119 | 119 | int res; |
| 120 | 120 | if (len > sizeof(mms->in_buffer)) { |
| 121 | 121 | av_log(NULL, AV_LOG_ERROR, |
| 122 | | "Data packet length %d exceeds the in_buffer size %zu\n", |
| | 122 | "Data packet length %d exceeds the in_buffer size %"SIZE_SPECIFIER"\n", |
| 123 | 123 | len, sizeof(mms->in_buffer)); |
| 124 | 124 | return AVERROR(EIO); |
| 125 | 125 | } |
| … |
… |
static int get_http_header_data(MMSHContext *mmsh)
|
| 194 | 194 | if (len) { |
| 195 | 195 | if (len > sizeof(mms->in_buffer)) { |
| 196 | 196 | av_log(NULL, AV_LOG_ERROR, |
| 197 | | "Other packet len = %d exceed the in_buffer size %zu\n", |
| | 197 | "Other packet len = %d exceed the in_buffer size %"SIZE_SPECIFIER"\n", |
| 198 | 198 | len, sizeof(mms->in_buffer)); |
| 199 | 199 | return AVERROR(EIO); |
| 200 | 200 | } |
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index ebef3ef..c851187 100644
|
a
|
b
|
static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
|
| 284 | 284 | if (length_remaining < 0 |
| 285 | 285 | || length_remaining > sizeof(mms->in_buffer) - 12) { |
| 286 | 286 | av_log(NULL, AV_LOG_ERROR, |
| 287 | | "Incoming packet length %d exceeds bufsize %zu\n", |
| | 287 | "Incoming packet length %d exceeds bufsize %"SIZE_SPECIFIER"\n", |
| 288 | 288 | length_remaining, sizeof(mms->in_buffer) - 12); |
| 289 | 289 | return AVERROR_INVALIDDATA; |
| 290 | 290 | } |
| … |
… |
static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
|
| 320 | 320 | if (length_remaining < 0 |
| 321 | 321 | || length_remaining > sizeof(mms->in_buffer) - 8) { |
| 322 | 322 | av_log(NULL, AV_LOG_ERROR, |
| 323 | | "Data length %d is invalid or too large (max=%zu)\n", |
| | 323 | "Data length %d is invalid or too large (max=%"SIZE_SPECIFIER")\n", |
| 324 | 324 | length_remaining, sizeof(mms->in_buffer)); |
| 325 | 325 | return AVERROR_INVALIDDATA; |
| 326 | 326 | } |
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 57f0c6d..06536f6 100644
|
a
|
b
|
int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
|
| 169 | 169 | |
| 170 | 170 | if (p != end) |
| 171 | 171 | av_log(as, AV_LOG_INFO, |
| 172 | | "%ti bytes of comment header remain\n", end - p); |
| | 172 | "%"PTRDIFF_SPECIFIER" bytes of comment header remain\n", end - p); |
| 173 | 173 | if (n > 0) |
| 174 | 174 | av_log(as, AV_LOG_INFO, |
| 175 | 175 | "truncated comment header, %i comments not found\n", n); |
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index 887a65e..43f72a2 100644
|
a
|
b
|
parse_packed_headers(const uint8_t * packed_headers,
|
| 256 | 256 | |
| 257 | 257 | if (packed_headers_end - packed_headers < 9) { |
| 258 | 258 | av_log(codec, AV_LOG_ERROR, |
| 259 | | "Invalid %td byte packed header.", |
| | 259 | "Invalid %"PTRDIFF_SPECIFIER" byte packed header.", |
| 260 | 260 | packed_headers_end - packed_headers); |
| 261 | 261 | return AVERROR_INVALIDDATA; |
| 262 | 262 | } |
| … |
… |
parse_packed_headers(const uint8_t * packed_headers,
|
| 278 | 278 | if (packed_headers_end - packed_headers != length || |
| 279 | 279 | length1 > length || length2 > length - length1) { |
| 280 | 280 | av_log(codec, AV_LOG_ERROR, |
| 281 | | "Bad packed header lengths (%d,%d,%td,%d)\n", length1, |
| | 281 | "Bad packed header lengths (%d,%d,%"PTRDIFF_SPECIFIER",%d)\n", length1, |
| 282 | 282 | length2, packed_headers_end - packed_headers, length); |
| 283 | 283 | return AVERROR_INVALIDDATA; |
| 284 | 284 | } |
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index ae29483..c53de90 100644
|
a
|
b
|
static char *extradata2psets(AVCodecContext *c)
|
| 217 | 217 | sps_end = r1; |
| 218 | 218 | } |
| 219 | 219 | if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) { |
| 220 | | av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r); |
| | 220 | av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"!\n", MAX_PSET_SIZE - (p - psets), r1 - r); |
| 221 | 221 | av_free(psets); |
| 222 | 222 | |
| 223 | 223 | return NULL; |
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 9c5546f..6e2aede 100644
|
a
|
b
|
void avpriv_request_sample(void *avc,
|
| 213 | 213 | |
| 214 | 214 | #if HAVE_LIBC_MSVCRT |
| 215 | 215 | #define avpriv_open ff_open |
| | 216 | #define PTRDIFF_SPECIFIER "Id" |
| | 217 | #define SIZE_SPECIFIER "Iu" |
| | 218 | #else |
| | 219 | #define PTRDIFF_SPECIFIER "td" |
| | 220 | #define SIZE_SPECIFIER "zu" |
| 216 | 221 | #endif |
| 217 | 222 | |
| 218 | 223 | /** |