Merge commit 'd92024f18fa3d69937cb2575f3a8bf973df02430'

* commit 'd92024f18fa3d69937cb2575f3a8bf973df02430':
  lavf: more correct printf format specifiers

Conflicts:
	libavformat/asfdec.c
	libavformat/cafdec.c
	libavformat/dxa.c
	libavformat/framecrcenc.c
	libavformat/hnm.c
	libavformat/iff.c
	libavformat/mov.c
	libavformat/mxfdec.c
	libavformat/rmdec.c
	libavformat/rpl.c
	libavformat/smacker.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/293/head
Michael Niedermayer 11 years ago
commit 28ee7757f5
  1. 6
      libavformat/apetag.c
  2. 8
      libavformat/asfdec.c
  3. 4
      libavformat/avidec.c
  4. 10
      libavformat/bink.c
  5. 5
      libavformat/cafdec.c
  6. 4
      libavformat/crcenc.c
  7. 7
      libavformat/dfa.c
  8. 5
      libavformat/dxa.c
  9. 8
      libavformat/electronicarts.c
  10. 4
      libavformat/framecrcenc.c
  11. 6
      libavformat/gxf.c
  12. 11
      libavformat/hnm.c
  13. 4
      libavformat/iff.c
  14. 9
      libavformat/lxfdec.c
  15. 3
      libavformat/matroskadec.c
  16. 5
      libavformat/mov.c
  17. 5
      libavformat/mvi.c
  18. 17
      libavformat/mxfdec.c
  19. 8
      libavformat/omadec.c
  20. 4
      libavformat/rmdec.c
  21. 5
      libavformat/rpl.c
  22. 8
      libavformat/smacker.c
  23. 8
      libavformat/smjpegdec.c
  24. 8
      libavformat/spdifenc.c
  25. 6
      libavformat/wtvdec.c
  26. 6
      libavformat/xmv.c

@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
#include "avformat.h" #include "avformat.h"
@ -139,14 +141,14 @@ int64_t ff_ape_parse_tag(AVFormatContext *s)
} }
if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) { if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) {
av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes); av_log(s, AV_LOG_ERROR, "Invalid tag size %"PRIu32".\n", tag_bytes);
return 0; return 0;
} }
tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES; tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES;
fields = avio_rl32(pb); /* number of fields */ fields = avio_rl32(pb); /* number of fields */
if (fields > 65536) { if (fields > 65536) {
av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields); av_log(s, AV_LOG_ERROR, "Too many tag fields (%"PRIu32")\n", fields);
return 0; return 0;
} }

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
@ -943,13 +945,13 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
// the following checks prevent overflows and infinite loops // the following checks prevent overflows and infinite loops
if (!packet_length || packet_length >= (1U << 29)) { if (!packet_length || packet_length >= (1U << 29)) {
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"invalid packet_length %d at:%"PRId64"\n", "invalid packet_length %"PRIu32" at:%"PRId64"\n",
packet_length, avio_tell(pb)); packet_length, avio_tell(pb));
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (padsize >= packet_length) { if (padsize >= packet_length) {
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"invalid padsize %d at:%"PRId64"\n", padsize, avio_tell(pb)); "invalid padsize %"PRIu32" at:%"PRId64"\n", padsize, avio_tell(pb));
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -968,7 +970,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
if (rsize > packet_length - padsize) { if (rsize > packet_length - padsize) {
asf->packet_size_left = 0; asf->packet_size_left = 0;
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"invalid packet header length %d for pktlen %d-%d at %"PRId64"\n", "invalid packet header length %d for pktlen %"PRIu32"-%"PRIu32" at %"PRId64"\n",
rsize, packet_length, padsize, avio_tell(pb)); rsize, packet_length, padsize, avio_tell(pb));
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <stdint.h> #include <inttypes.h>
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
@ -597,7 +597,7 @@ static int avi_read_header(AVFormatContext *s)
ast->rate = avio_rl32(pb); ast->rate = avio_rl32(pb);
if (!(ast->scale && ast->rate)) { if (!(ast->scale && ast->rate)) {
av_log(s, AV_LOG_WARNING, av_log(s, AV_LOG_WARNING,
"scale/rate is %u/%u which is invalid. " "scale/rate is %"PRIu32"/%"PRIu32" which is invalid. "
"(This file has been generated by broken software.)\n", "(This file has been generated by broken software.)\n",
ast->scale, ast->scale,
ast->rate); ast->rate);

@ -28,6 +28,8 @@
* http://wiki.multimedia.cx/index.php?title=Bink_Container * http://wiki.multimedia.cx/index.php?title=Bink_Container
*/ */
#include <inttypes.h>
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
@ -111,7 +113,9 @@ static int read_header(AVFormatContext *s)
fps_num = avio_rl32(pb); fps_num = avio_rl32(pb);
fps_den = avio_rl32(pb); fps_den = avio_rl32(pb);
if (fps_num == 0 || fps_den == 0) { if (fps_num == 0 || fps_den == 0) {
av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den); av_log(s, AV_LOG_ERROR,
"invalid header: invalid fps (%"PRIu32"/%"PRIu32")\n",
fps_num, fps_den);
return AVERROR(EIO); return AVERROR(EIO);
} }
avpriv_set_pts_info(vst, 64, fps_den, fps_num); avpriv_set_pts_info(vst, 64, fps_den, fps_num);
@ -132,7 +136,7 @@ static int read_header(AVFormatContext *s)
if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) { if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) {
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n", "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%"PRIu32")\n",
bink->num_audio_tracks); bink->num_audio_tracks);
return AVERROR(EIO); return AVERROR(EIO);
} }
@ -226,7 +230,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t audio_size = avio_rl32(pb); uint32_t audio_size = avio_rl32(pb);
if (audio_size > bink->remain_packet_size - 4) { if (audio_size > bink->remain_packet_size - 4) {
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n", "frame %"PRId64": audio size in header (%"PRIu32") > size of packet left (%"PRIu32")\n",
bink->video_pts, audio_size, bink->remain_packet_size); bink->video_pts, audio_size, bink->remain_packet_size);
return AVERROR(EIO); return AVERROR(EIO);
} }

@ -25,6 +25,8 @@
* Core Audio Format demuxer * Core Audio Format demuxer
*/ */
#include <inttypes.h>
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
#include "isom.h" #include "isom.h"
@ -285,7 +287,8 @@ static int read_header(AVFormatContext *s)
default: default:
#define _(x) ((x) >= ' ' ? (x) : ' ') #define _(x) ((x) >= ' ' ? (x) : ' ')
av_log(s, AV_LOG_WARNING, "skipping CAF chunk: %08X (%c%c%c%c), size %"PRId64"\n", av_log(s, AV_LOG_WARNING,
"skipping CAF chunk: %08"PRIX32" (%"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8"), size %"PRId64"\n",
tag, _(tag>>24), _((tag>>16)&0xFF), _((tag>>8)&0xFF), _(tag&0xFF), size); tag, _(tag>>24), _((tag>>16)&0xFF), _((tag>>8)&0xFF), _(tag&0xFF), size);
#undef _ #undef _
case MKBETAG('f','r','e','e'): case MKBETAG('f','r','e','e'):

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/adler32.h" #include "libavutil/adler32.h"
#include "avformat.h" #include "avformat.h"
@ -48,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s)
CRCState *crc = s->priv_data; CRCState *crc = s->priv_data;
char buf[64]; char buf[64];
snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval); snprintf(buf, sizeof(buf), "CRC=0x%08"PRIx32"\n", crc->crcval);
avio_write(s->pb, buf, strlen(buf)); avio_write(s->pb, buf, strlen(buf));
return 0; return 0;

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
@ -98,12 +100,13 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt)
first = 0; first = 0;
frame_size = AV_RL32(pkt->data + pkt->size - 8); frame_size = AV_RL32(pkt->data + pkt->size - 8);
if (frame_size > INT_MAX - 4) { if (frame_size > INT_MAX - 4) {
av_log(s, AV_LOG_ERROR, "Too large chunk size: %d\n", frame_size); av_log(s, AV_LOG_ERROR, "Too large chunk size: %"PRIu32"\n", frame_size);
return AVERROR(EIO); return AVERROR(EIO);
} }
if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) { if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) {
if (frame_size) { if (frame_size) {
av_log(s, AV_LOG_WARNING, "skipping %d bytes of end-of-frame marker chunk\n", av_log(s, AV_LOG_WARNING,
"skipping %"PRIu32" bytes of end-of-frame marker chunk\n",
frame_size); frame_size);
avio_skip(pb, frame_size); avio_skip(pb, frame_size);
} }

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
@ -196,7 +198,8 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
} }
size = AV_RB32(buf + 5); size = AV_RB32(buf + 5);
if(size > 0xFFFFFF){ if(size > 0xFFFFFF){
av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size); av_log(s, AV_LOG_ERROR, "Frame size is too big: %"PRIu32"\n",
size);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0)

@ -25,6 +25,8 @@
* by Robin Kay (komadori at gekkou.co.uk) * by Robin Kay (komadori at gekkou.co.uk)
*/ */
#include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
@ -152,7 +154,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break; break;
case 0x8A: case 0x8A:
av_log(s, AV_LOG_DEBUG, av_log(s, AV_LOG_DEBUG,
"element 0x%02x set to 0x%08x\n", "element 0x%02x set to 0x%08"PRIx32"\n",
subbyte, read_arbitrary(pb)); subbyte, read_arbitrary(pb));
av_log(s, AV_LOG_DEBUG, "exited audio subheader\n"); av_log(s, AV_LOG_DEBUG, "exited audio subheader\n");
in_subheader = 0; in_subheader = 0;
@ -171,7 +173,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break; break;
default: default:
av_log(s, AV_LOG_DEBUG, av_log(s, AV_LOG_DEBUG,
"element 0x%02x set to 0x%08x\n", "element 0x%02x set to 0x%08"PRIx32"\n",
subbyte, read_arbitrary(pb)); subbyte, read_arbitrary(pb));
break; break;
} }
@ -183,7 +185,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break; break;
default: default:
av_log(s, AV_LOG_DEBUG, av_log(s, AV_LOG_DEBUG,
"header element 0x%02x set to 0x%08x\n", "header element 0x%02x set to 0x%08"PRIx32"\n",
byte, read_arbitrary(pb)); byte, read_arbitrary(pb));
break; break;
} }

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/adler32.h" #include "libavutil/adler32.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "avformat.h" #include "avformat.h"
@ -29,7 +31,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
uint32_t crc = av_adler32_update(0, pkt->data, pkt->size); uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
char buf[256]; char buf[256];
snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x", snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08"PRIx32,
pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc); pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc);
if (pkt->flags != AV_PKT_FLAG_KEY) if (pkt->flags != AV_PKT_FLAG_KEY)
av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags); av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags);

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "avformat.h" #include "avformat.h"
@ -293,7 +295,9 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) {
} }
st = s->streams[0]; st = s->streams[0];
if (map_cnt > 1000) { if (map_cnt > 1000) {
av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt); av_log(s, AV_LOG_ERROR,
"too many index entries %"PRIu32" (%"PRIx32")\n",
map_cnt, map_cnt);
map_cnt = 1000; map_cnt = 1000;
} }
if (pkt_len < 4 * map_cnt) { if (pkt_len < 4 * map_cnt) {

@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
@ -149,8 +151,9 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_skip(pb, 2); avio_skip(pb, 2);
if (chunk_size > hnm->superchunk_remaining || !chunk_size) { if (chunk_size > hnm->superchunk_remaining || !chunk_size) {
av_log(s, AV_LOG_ERROR, "invalid chunk size: %u, offset: %u\n", av_log(s, AV_LOG_ERROR,
chunk_size, (int) avio_tell(pb)); "invalid chunk size: %"PRIu32", offset: %"PRId64"\n",
chunk_size, avio_tell(pb));
avio_skip(pb, hnm->superchunk_remaining - 8); avio_skip(pb, hnm->superchunk_remaining - 8);
hnm->superchunk_remaining = 0; hnm->superchunk_remaining = 0;
} }
@ -172,8 +175,8 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
break; break;
default: default:
av_log(s, AV_LOG_WARNING, "unknown chunk found: %d, offset: %d\n", av_log(s, AV_LOG_WARNING, "unknown chunk found: %"PRIu16", offset: %"PRId64"\n",
chunk_id, (int) avio_tell(pb)); chunk_id, avio_tell(pb));
avio_skip(pb, chunk_size - 8); avio_skip(pb, chunk_size - 8);
hnm->superchunk_remaining -= chunk_size; hnm->superchunk_remaining -= chunk_size;
break; break;

@ -28,6 +28,8 @@
* http://wiki.multimedia.cx/index.php?title=IFF * http://wiki.multimedia.cx/index.php?title=IFF
*/ */
#include <inttypes.h>
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
@ -251,7 +253,7 @@ static int iff_read_header(AVFormatContext *s)
case ID_CMAP: case ID_CMAP:
if (data_size < 3 || data_size > 768 || data_size % 3) { if (data_size < 3 || data_size > 768 || data_size % 3) {
av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n", av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %"PRIu32"\n",
data_size); data_size);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "avformat.h" #include "avformat.h"
@ -128,12 +130,12 @@ static int get_packet_header(AVFormatContext *s)
version = bytestream_get_le32(&p); version = bytestream_get_le32(&p);
header_size = bytestream_get_le32(&p); header_size = bytestream_get_le32(&p);
if (version > 1) if (version > 1)
avpriv_request_sample(s, "Unknown format version %i\n", version); avpriv_request_sample(s, "Unknown format version %"PRIu32"\n", version);
if (header_size < (version ? 72 : 60) || if (header_size < (version ? 72 : 60) ||
header_size > LXF_MAX_PACKET_HEADER_SIZE || header_size > LXF_MAX_PACKET_HEADER_SIZE ||
(header_size & 3)) { (header_size & 3)) {
av_log(s, AV_LOG_ERROR, "Invalid header size 0x%x\n", header_size); av_log(s, AV_LOG_ERROR, "Invalid header size 0x%"PRIx32"\n", header_size);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -301,7 +303,8 @@ static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
stream = lxf->packet_type; stream = lxf->packet_type;
if (stream > 1) { if (stream > 1) {
av_log(s, AV_LOG_WARNING, "got packet with illegal stream index %u\n", stream); av_log(s, AV_LOG_WARNING,
"got packet with illegal stream index %"PRIu32"\n", stream);
return AVERROR(EAGAIN); return AVERROR(EAGAIN);
} }

@ -30,6 +30,7 @@
#include "config.h" #include "config.h"
#include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#if CONFIG_BZLIB #if CONFIG_BZLIB
#include <bzlib.h> #include <bzlib.h>
@ -921,7 +922,7 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
matroska->levels[matroska->num_levels - 1].length == 0xffffffffffffff) matroska->levels[matroska->num_levels - 1].length == 0xffffffffffffff)
return 0; // we reached the end of an unknown size cluster return 0; // we reached the end of an unknown size cluster
if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) { if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) {
av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id); av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%"PRIX32"\n", id);
if (matroska->ctx->error_recognition & AV_EF_EXPLODE) if (matroska->ctx->error_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }

@ -23,6 +23,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
@ -767,7 +768,7 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);
av_dict_set(&c->fc->metadata, "major_brand", type, 0); av_dict_set(&c->fc->metadata, "major_brand", type, 0);
minor_ver = avio_rb32(pb); /* minor version */ minor_ver = avio_rb32(pb); /* minor version */
snprintf(minor_ver_str, sizeof(minor_ver_str), "%d", minor_ver); snprintf(minor_ver_str, sizeof(minor_ver_str), "%"PRIu32"", minor_ver);
av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0); av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0);
comp_brand_size = atom.size - 8; comp_brand_size = atom.size - 8;
@ -1649,7 +1650,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
id = mov_codec_id(st, format); id = mov_codec_id(st, format);
av_dlog(c->fc, "size=%"PRId64" 4CC= %c%c%c%c codec_type=%d\n", size, av_dlog(c->fc, "size=%"PRId64" 4CC= %"PRIu8"%"PRIu8"%"PRIu8"%"PRIu8" codec_type=%d\n", size,
(format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
(format >> 24) & 0xff, st->codec->codec_type); (format >> 24) & 0xff, st->codec->codec_type);

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
@ -95,7 +97,8 @@ static int read_header(AVFormatContext *s)
mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count; mvi->audio_frame_size = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count;
if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) { if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) {
av_log(s, AV_LOG_ERROR, "Invalid audio_data_size (%d) or frames_count (%d)\n", av_log(s, AV_LOG_ERROR,
"Invalid audio_data_size (%"PRIu32") or frames_count (%u)\n",
mvi->audio_data_size, frames_count); mvi->audio_data_size, frames_count);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }

@ -43,7 +43,7 @@
* Only tracks with associated descriptors will be decoded. "Highly Desirable" SMPTE 377M D.1 * Only tracks with associated descriptors will be decoded. "Highly Desirable" SMPTE 377M D.1
*/ */
#include <stdint.h> #include <inttypes.h>
#include "libavutil/aes.h" #include "libavutil/aes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
@ -542,8 +542,10 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
/* only nag once */ /* only nag once */
if (!mxf->op) if (!mxf->op)
av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %u ECs - assuming %s\n", av_log(mxf->fc, AV_LOG_WARNING,
nb_essence_containers, op == OP1a ? "OP1a" : "OPAtom"); "\"OPAtom\" with %"PRIu32" ECs - assuming %s\n",
nb_essence_containers,
op == OP1a ? "OP1a" : "OPAtom");
mxf->op = op; mxf->op = op;
} else } else
@ -554,14 +556,15 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
} }
if (partition->kag_size <= 0 || partition->kag_size > (1 << 20)) { if (partition->kag_size <= 0 || partition->kag_size > (1 << 20)) {
av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %i - guessing ", partition->kag_size); av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %"PRId32" - guessing ",
partition->kag_size);
if (mxf->op == OPSONYOpt) if (mxf->op == OPSONYOpt)
partition->kag_size = 512; partition->kag_size = 512;
else else
partition->kag_size = 1; partition->kag_size = 1;
av_log(mxf->fc, AV_LOG_WARNING, "%i\n", partition->kag_size); av_log(mxf->fc, AV_LOG_WARNING, "%"PRId32"\n", partition->kag_size);
} }
return 0; return 0;
@ -2324,7 +2327,9 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *codec; AVCodecContext *codec;
if (index < 0) { if (index < 0) {
av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12)); av_log(s, AV_LOG_ERROR,
"error getting stream index %"PRIu32"\n",
AV_RB32(klv.key + 12));
goto skip; goto skip;
} }

@ -40,6 +40,8 @@
* Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM * Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM
*/ */
#include <inttypes.h>
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
@ -215,7 +217,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
if (geob->datasize < 64) { if (geob->datasize < 64) {
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"Invalid GEOB data size: %u\n", geob->datasize); "Invalid GEOB data size: %"PRIu32"\n", geob->datasize);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -239,7 +241,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]); oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid); av_log(s, AV_LOG_DEBUG, "RID: %.8"PRIx32"\n", oc->rid);
memcpy(oc->iv, &header[0x58], 8); memcpy(oc->iv, &header[0x58], 8);
hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8); hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8);
@ -366,7 +368,7 @@ static int oma_read_header(AVFormatContext *s)
channel_id = (codec_params >> 10) & 7; channel_id = (codec_params >> 10) & 7;
if (!channel_id) { if (!channel_id) {
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"Invalid ATRAC-X channel id: %d\n", channel_id); "Invalid ATRAC-X channel id: %"PRIu32"\n", channel_id);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
st->codec->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1]; st->codec->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <inttypes.h>
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
@ -279,7 +281,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
case DEINT_ID_VBRF: case DEINT_ID_VBRF:
break; break;
default: default:
av_log(s, AV_LOG_ERROR, "Unknown interleaver %X\n", ast->deint_id); av_log(s, AV_LOG_ERROR ,"Unknown interleaver %"PRIX32"\n", ast->deint_id);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (ast->deint_id == DEINT_ID_INT4 || if (ast->deint_id == DEINT_ID_INT4 ||

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <stdint.h> #include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
@ -222,7 +222,8 @@ static int rpl_read_header(AVFormatContext *s)
break; break;
} }
if (ast->codec->codec_id == AV_CODEC_ID_NONE) if (ast->codec->codec_id == AV_CODEC_ID_NONE)
avpriv_request_sample(s, "Audio format %i", audio_format); avpriv_request_sample(s, "Audio format %"PRId32,
audio_format);
avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate); avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate);
} else { } else {
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)

@ -23,6 +23,8 @@
* Based on http://wiki.multimedia.cx/index.php?title=Smacker * Based on http://wiki.multimedia.cx/index.php?title=Smacker
*/ */
#include <inttypes.h>
#include "libavutil/bswap.h" #include "libavutil/bswap.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
@ -142,7 +144,7 @@ static int smacker_read_header(AVFormatContext *s)
smk->pad = avio_rl32(pb); smk->pad = avio_rl32(pb);
/* setup data */ /* setup data */
if(smk->frames > 0xFFFFFF) { if(smk->frames > 0xFFFFFF) {
av_log(s, AV_LOG_ERROR, "Too many frames: %i\n", smk->frames); av_log(s, AV_LOG_ERROR, "Too many frames: %"PRIu32"\n", smk->frames);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
smk->frm_size = av_malloc_array(smk->frames, sizeof(*smk->frm_size)); smk->frm_size = av_malloc_array(smk->frames, sizeof(*smk->frm_size));
@ -221,7 +223,9 @@ static int smacker_read_header(AVFormatContext *s)
/* load trees to extradata, they will be unpacked by decoder */ /* load trees to extradata, they will be unpacked by decoder */
if(ff_alloc_extradata(st->codec, smk->treesize + 16)){ if(ff_alloc_extradata(st->codec, smk->treesize + 16)){
av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16); av_log(s, AV_LOG_ERROR,
"Cannot allocate %"PRIu32" bytes of extradata\n",
smk->treesize + 16);
av_freep(&smk->frm_size); av_freep(&smk->frm_size);
av_freep(&smk->frm_flags); av_freep(&smk->frm_flags);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

@ -24,6 +24,8 @@
* This is a demuxer for Loki SDL Motion JPEG files * This is a demuxer for Loki SDL Motion JPEG files
*/ */
#include <inttypes.h>
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
#include "riff.h" #include "riff.h"
@ -52,7 +54,7 @@ static int smjpeg_read_header(AVFormatContext *s)
avio_skip(pb, 8); // magic avio_skip(pb, 8); // magic
version = avio_rb32(pb); version = avio_rb32(pb);
if (version) if (version)
avpriv_request_sample(s, "Unknown version %d", version); avpriv_request_sample(s, "Unknown version %"PRIu32, version);
duration = avio_rb32(pb); // in msec duration = avio_rb32(pb); // in msec
@ -124,7 +126,7 @@ static int smjpeg_read_header(AVFormatContext *s)
case SMJPEG_HEND: case SMJPEG_HEND:
return 0; return 0;
default: default:
av_log(s, AV_LOG_ERROR, "unknown header %x\n", htype); av_log(s, AV_LOG_ERROR, "unknown header %"PRIx32"\n", htype);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} }
@ -164,7 +166,7 @@ static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = AVERROR_EOF; ret = AVERROR_EOF;
break; break;
default: default:
av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", dtype); av_log(s, AV_LOG_ERROR, "unknown chunk %"PRIx32"\n", dtype);
ret = AVERROR_INVALIDDATA; ret = AVERROR_INVALIDDATA;
break; break;
} }

@ -44,6 +44,8 @@
* dependent from data-type (spaces between packets are filled by zeros) * dependent from data-type (spaces between packets are filled by zeros)
*/ */
#include <inttypes.h>
#include "avformat.h" #include "avformat.h"
#include "avio_internal.h" #include "avio_internal.h"
#include "spdif.h" #include "spdif.h"
@ -274,7 +276,7 @@ static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR, "stray DTS-HD frame\n"); av_log(s, AV_LOG_ERROR, "stray DTS-HD frame\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
default: default:
av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%x\n", syncword_dts); av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%"PRIx32"\n", syncword_dts);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
blocks++; blocks++;
@ -369,8 +371,8 @@ static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096; ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096;
break; break;
default: default:
av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n", av_log(s, AV_LOG_ERROR,
hdr.samples); "%"PRIu32" samples in AAC frame not supported\n", hdr.samples);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
//TODO Data type dependent info (LC profile/SBR) //TODO Data type dependent info (LC profile/SBR)

@ -25,6 +25,8 @@
* @author Peter Ross <pross@xvid.org> * @author Peter Ross <pross@xvid.org>
*/ */
#include <inttypes.h>
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h" #include "libavutil/intfloat.h"
@ -35,7 +37,7 @@
/* Macros for formating GUIDs */ /* Macros for formating GUIDs */
#define PRI_PRETTY_GUID \ #define PRI_PRETTY_GUID \
"%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x" "%08"PRIx32"-%04"PRIx16"-%04"PRIx16"-%02x%02x%02x%02x%02x%02x%02x%02x"
#define ARG_PRETTY_GUID(g) \ #define ARG_PRETTY_GUID(g) \
AV_RL32(g),AV_RL16(g+4),AV_RL16(g+6),g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15] AV_RL32(g),AV_RL16(g+4),AV_RL16(g+6),g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]
#define LEN_PRETTY_GUID 34 #define LEN_PRETTY_GUID 34
@ -471,7 +473,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
return; return;
if (type == 0 && length == 4) { if (type == 0 && length == 4) {
snprintf(buf, buf_size, "%"PRIi32, avio_rl32(pb)); snprintf(buf, buf_size, "%u", avio_rl32(pb));
} else if (type == 1) { } else if (type == 1) {
avio_get_str16le(pb, length, buf, buf_size); avio_get_str16le(pb, length, buf, buf_size);
if (!strlen(buf)) { if (!strlen(buf)) {

@ -25,7 +25,7 @@
* Microsoft XMV demuxer * Microsoft XMV demuxer
*/ */
#include <stdint.h> #include <inttypes.h>
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
@ -155,7 +155,7 @@ static int xmv_read_header(AVFormatContext *s)
file_version = avio_rl32(pb); file_version = avio_rl32(pb);
if ((file_version != 4) && (file_version != 2)) if ((file_version != 4) && (file_version != 2))
avpriv_request_sample(s, "Uncommon version %d", file_version); avpriv_request_sample(s, "Uncommon version %"PRIu32"", file_version);
/* Video track */ /* Video track */
@ -219,7 +219,7 @@ static int xmv_read_header(AVFormatContext *s)
if (!packet->channels || !packet->sample_rate || if (!packet->channels || !packet->sample_rate ||
packet->channels >= UINT16_MAX / XMV_BLOCK_ALIGN_SIZE) { packet->channels >= UINT16_MAX / XMV_BLOCK_ALIGN_SIZE) {
av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %d.\n", av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %"PRIu16".\n",
audio_track); audio_track);
ret = AVERROR_INVALIDDATA; ret = AVERROR_INVALIDDATA;
goto fail; goto fail;

Loading…
Cancel
Save