Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d92024f1
Commit
d92024f1
authored
Mar 10, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: more correct printf format specifiers
parent
7caf48e0
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
114 additions
and
57 deletions
+114
-57
apetag.c
libavformat/apetag.c
+4
-2
asfdec.c
libavformat/asfdec.c
+5
-3
avidec.c
libavformat/avidec.c
+2
-2
bink.c
libavformat/bink.c
+7
-3
cafdec.c
libavformat/cafdec.c
+4
-1
crcenc.c
libavformat/crcenc.c
+3
-1
dfa.c
libavformat/dfa.c
+5
-2
dxa.c
libavformat/dxa.c
+4
-1
electronicarts.c
libavformat/electronicarts.c
+5
-3
framecrcenc.c
libavformat/framecrcenc.c
+3
-1
gxf.c
libavformat/gxf.c
+5
-1
hnm.c
libavformat/hnm.c
+7
-4
iff.c
libavformat/iff.c
+3
-1
lxfdec.c
libavformat/lxfdec.c
+6
-3
matroskadec.c
libavformat/matroskadec.c
+2
-1
mov.c
libavformat/mov.c
+4
-3
mvi.c
libavformat/mvi.c
+4
-1
mxfdec.c
libavformat/mxfdec.c
+8
-5
omadec.c
libavformat/omadec.c
+5
-3
rmdec.c
libavformat/rmdec.c
+3
-1
rpl.c
libavformat/rpl.c
+2
-2
smacker.c
libavformat/smacker.c
+6
-2
smjpegdec.c
libavformat/smjpegdec.c
+5
-3
spdifenc.c
libavformat/spdifenc.c
+5
-3
wtv.c
libavformat/wtv.c
+4
-2
xmv.c
libavformat/xmv.c
+3
-3
No files found.
libavformat/apetag.c
View file @
d92024f1
...
...
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
...
...
@@ -147,14 +149,14 @@ int64_t ff_ape_parse_tag(AVFormatContext *s)
}
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
;
}
tag_start
=
file_size
-
tag_bytes
-
APE_TAG_FOOTER_BYTES
;
fields
=
avio_rl32
(
pb
);
/* number of fields */
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
;
}
...
...
libavformat/asfdec.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
...
...
@@ -921,13 +923,13 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
// the following checks prevent overflows and infinite loops
if
(
!
packet_length
||
packet_length
>=
(
1U
<<
29
))
{
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
));
return
-
1
;
}
if
(
padsize
>=
packet_length
)
{
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
-
1
;
}
...
...
@@ -946,7 +948,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
if
(
rsize
>
packet_length
-
padsize
)
{
asf
->
packet_size_left
=
0
;
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
));
return
-
1
;
}
...
...
libavformat/avidec.c
View file @
d92024f1
...
...
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <
stdint
.h>
#include <
inttypes
.h>
#include "libavutil/avstring.h"
#include "libavutil/bswap.h"
...
...
@@ -525,7 +525,7 @@ static int avi_read_header(AVFormatContext *s)
ast
->
rate
=
avio_rl32
(
pb
);
if
(
!
(
ast
->
scale
&&
ast
->
rate
))
{
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
"
,
ast
->
scale
,
ast
->
rate
);
...
...
libavformat/bink.c
View file @
d92024f1
...
...
@@ -28,6 +28,8 @@
* http://wiki.multimedia.cx/index.php?title=Bink_Container
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
...
...
@@ -108,7 +110,9 @@ static int read_header(AVFormatContext *s)
fps_num
=
avio_rl32
(
pb
);
fps_den
=
avio_rl32
(
pb
);
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
);
}
avpriv_set_pts_info
(
vst
,
64
,
fps_den
,
fps_num
);
...
...
@@ -126,7 +130,7 @@ static int read_header(AVFormatContext *s)
if
(
bink
->
num_audio_tracks
>
BINK_MAX_AUDIO_TRACKS
)
{
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
);
return
AVERROR
(
EIO
);
}
...
...
@@ -221,7 +225,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t
audio_size
=
avio_rl32
(
pb
);
if
(
audio_size
>
bink
->
remain_packet_size
-
4
)
{
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
);
return
AVERROR
(
EIO
);
}
...
...
libavformat/cafdec.c
View file @
d92024f1
...
...
@@ -25,6 +25,8 @@
* Core Audio Format demuxer
*/
#include <inttypes.h>
#include "avformat.h"
#include "internal.h"
#include "isom.h"
...
...
@@ -289,7 +291,8 @@ static int read_header(AVFormatContext *s)
default:
#define _(x) ((x) >= ' ' ? (x) : ' ')
av_log
(
s
,
AV_LOG_WARNING
,
"skipping CAF chunk: %08X (%c%c%c%c)
\n
"
,
av_log
(
s
,
AV_LOG_WARNING
,
"skipping CAF chunk: %08"
PRIX32
" (%"
PRIu8
"%"
PRIu8
"%"
PRIu8
"%"
PRIu8
")
\n
"
,
tag
,
_
(
tag
>>
24
),
_
((
tag
>>
16
)
&
0xFF
),
_
((
tag
>>
8
)
&
0xFF
),
_
(
tag
&
0xFF
));
#undef _
case
MKBETAG
(
'f'
,
'r'
,
'e'
,
'e'
):
...
...
libavformat/crcenc.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/adler32.h"
#include "avformat.h"
...
...
@@ -48,7 +50,7 @@ static int crc_write_trailer(struct AVFormatContext *s)
CRCState
*
crc
=
s
->
priv_data
;
char
buf
[
64
];
snprintf
(
buf
,
sizeof
(
buf
),
"CRC=0x%08
x
\n
"
,
crc
->
crcval
);
snprintf
(
buf
,
sizeof
(
buf
),
"CRC=0x%08
"
PRIx32
"
\n
"
,
crc
->
crcval
);
avio_write
(
s
->
pb
,
buf
,
strlen
(
buf
));
return
0
;
...
...
libavformat/dfa.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -87,12 +89,13 @@ static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt)
first
=
0
;
frame_size
=
AV_RL32
(
pkt
->
data
+
pkt
->
size
-
8
);
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
);
}
if
(
AV_RL32
(
pkt
->
data
+
pkt
->
size
-
12
)
==
MKTAG
(
'E'
,
'O'
,
'F'
,
'R'
))
{
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
);
avio_skip
(
pb
,
frame_size
);
}
...
...
libavformat/dxa.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -190,7 +192,8 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_read
(
s
->
pb
,
buf
+
4
,
DXA_EXTRA_SIZE
-
4
);
size
=
AV_RB32
(
buf
+
5
);
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
-
1
;
}
if
(
av_new_packet
(
pkt
,
size
+
DXA_EXTRA_SIZE
+
pal_size
)
<
0
)
...
...
libavformat/electronicarts.c
View file @
d92024f1
...
...
@@ -25,6 +25,8 @@
* by Robin Kay (komadori at gekkou.co.uk)
*/
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -151,7 +153,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break
;
case
0x8A
:
av_log
(
s
,
AV_LOG_DEBUG
,
"element 0x%02x set to 0x%08
x
\n
"
,
"element 0x%02x set to 0x%08
"
PRIx32
"
\n
"
,
subbyte
,
read_arbitrary
(
pb
));
av_log
(
s
,
AV_LOG_DEBUG
,
"exited audio subheader
\n
"
);
in_subheader
=
0
;
...
...
@@ -170,7 +172,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break
;
default:
av_log
(
s
,
AV_LOG_DEBUG
,
"element 0x%02x set to 0x%08
x
\n
"
,
"element 0x%02x set to 0x%08
"
PRIx32
"
\n
"
,
subbyte
,
read_arbitrary
(
pb
));
break
;
}
...
...
@@ -182,7 +184,7 @@ static int process_audio_header_elements(AVFormatContext *s)
break
;
default:
av_log
(
s
,
AV_LOG_DEBUG
,
"header element 0x%02x set to 0x%08
x
\n
"
,
"header element 0x%02x set to 0x%08
"
PRIx32
"
\n
"
,
byte
,
read_arbitrary
(
pb
));
break
;
}
...
...
libavformat/framecrcenc.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/adler32.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -28,7 +30,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
uint32_t
crc
=
av_adler32_update
(
0
,
pkt
->
data
,
pkt
->
size
);
char
buf
[
256
];
snprintf
(
buf
,
sizeof
(
buf
),
"%d, %10"
PRId64
", %10"
PRId64
", %8d, %8d, 0x%08
x
\n
"
,
snprintf
(
buf
,
sizeof
(
buf
),
"%d, %10"
PRId64
", %10"
PRId64
", %8d, %8d, 0x%08
"
PRIx32
"
\n
"
,
pkt
->
stream_index
,
pkt
->
dts
,
pkt
->
pts
,
pkt
->
duration
,
pkt
->
size
,
crc
);
avio_write
(
s
->
pb
,
buf
,
strlen
(
buf
));
return
0
;
...
...
libavformat/gxf.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "avformat.h"
...
...
@@ -259,7 +261,9 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) {
return
;
}
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
;
}
if
(
pkt_len
<
4
*
map_cnt
)
{
...
...
libavformat/hnm.c
View file @
d92024f1
...
...
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -149,8 +151,9 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_skip
(
pb
,
2
);
if
(
chunk_size
>
hnm
->
superchunk_remaining
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid chunk size: %u, offset: %u
\n
"
,
chunk_size
,
(
int
)
avio_tell
(
pb
));
av_log
(
s
,
AV_LOG_ERROR
,
"invalid chunk size: %"
PRIu32
", offset: %"
PRId64
"
\n
"
,
chunk_size
,
avio_tell
(
pb
));
avio_skip
(
pb
,
hnm
->
superchunk_remaining
-
8
);
hnm
->
superchunk_remaining
=
0
;
}
...
...
@@ -172,8 +175,8 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
break
;
default:
av_log
(
s
,
AV_LOG_WARNING
,
"unknown chunk found: %
d, offset: %d
\n
"
,
chunk_id
,
(
int
)
avio_tell
(
pb
));
av_log
(
s
,
AV_LOG_WARNING
,
"unknown chunk found: %
"
PRIu16
", offset: %"
PRId64
"
\n
"
,
chunk_id
,
avio_tell
(
pb
));
avio_skip
(
pb
,
chunk_size
-
8
);
hnm
->
superchunk_remaining
-=
chunk_size
;
break
;
...
...
libavformat/iff.c
View file @
d92024f1
...
...
@@ -29,6 +29,8 @@
* http://wiki.multimedia.cx/index.php?title=IFF
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
...
...
@@ -167,7 +169,7 @@ static int iff_read_header(AVFormatContext *s)
case
ID_CMAP
:
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
);
return
AVERROR_INVALIDDATA
;
}
...
...
libavformat/lxfdec.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
...
...
@@ -128,12 +130,12 @@ static int get_packet_header(AVFormatContext *s)
version
=
bytestream_get_le32
(
&
p
);
header_size
=
bytestream_get_le32
(
&
p
);
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
)
||
header_size
>
LXF_MAX_PACKET_HEADER_SIZE
||
(
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
;
}
...
...
@@ -299,7 +301,8 @@ static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
stream
=
lxf
->
packet_type
;
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
);
}
...
...
libavformat/matroskadec.c
View file @
d92024f1
...
...
@@ -30,6 +30,7 @@
#include "config.h"
#include <inttypes.h>
#include <stdio.h>
#if CONFIG_BZLIB
#include <bzlib.h>
...
...
@@ -824,7 +825,7 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
matroska
->
levels
[
matroska
->
num_levels
-
1
].
length
==
0xffffffffffffff
)
return
0
;
// we reached the end of an unknown size cluster
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
)
return
AVERROR_INVALIDDATA
;
}
...
...
libavformat/mov.c
View file @
d92024f1
...
...
@@ -23,6 +23,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
...
...
@@ -650,7 +651,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_dict_set
(
&
c
->
fc
->
metadata
,
"major_brand"
,
type
,
0
);
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
);
comp_brand_size
=
atom
.
size
-
8
;
...
...
@@ -1441,7 +1442,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
avio_rb16
(
pb
);
/* reserved */
dref_id
=
avio_rb16
(
pb
);
}
else
{
av_log
(
c
->
fc
,
AV_LOG_ERROR
,
"invalid size %
d
in stsd
\n
"
,
size
);
av_log
(
c
->
fc
,
AV_LOG_ERROR
,
"invalid size %
"
PRIu32
"
in stsd
\n
"
,
size
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -1454,7 +1455,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
id
=
mov_codec_id
(
st
,
format
);
av_dlog
(
c
->
fc
,
"size=%
d 4CC= %c%c%c%c
codec_type=%d
\n
"
,
size
,
av_dlog
(
c
->
fc
,
"size=%
"
PRIu32
" 4CC= %"
PRIu8
"%"
PRIu8
"%"
PRIu8
"%"
PRIu8
"
codec_type=%d
\n
"
,
size
,
(
format
>>
0
)
&
0xff
,
(
format
>>
8
)
&
0xff
,
(
format
>>
16
)
&
0xff
,
(
format
>>
24
)
&
0xff
,
st
->
codec
->
codec_type
);
...
...
libavformat/mvi.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "avformat.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
;
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
);
return
AVERROR_INVALIDDATA
;
}
...
...
libavformat/mxfdec.c
View file @
d92024f1
...
...
@@ -43,7 +43,7 @@
* 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/mathematics.h"
...
...
@@ -526,7 +526,7 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
/* only nag once */
if
(
!
mxf
->
op
)
av_log
(
mxf
->
fc
,
AV_LOG_WARNING
,
"
\"
OPAtom
\"
with %
u
ECs - assuming %s
\n
"
,
"
\"
OPAtom
\"
with %
"
PRIu32
"
ECs - assuming %s
\n
"
,
nb_essence_containers
,
op
==
OP1a
?
"OP1a"
:
"OPAtom"
);
...
...
@@ -539,14 +539,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
))
{
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
)
partition
->
kag_size
=
512
;
else
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
;
...
...
@@ -2296,7 +2297,9 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
AVCodecContext
*
codec
;
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
;
}
...
...
libavformat/omadec.c
View file @
d92024f1
...
...
@@ -40,6 +40,8 @@
* Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -219,7 +221,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
if
(
geob
->
datasize
<
64
)
{
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
;
}
...
...
@@ -243,7 +245,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
return
AVERROR_INVALIDDATA
;
}
oc
->
rid
=
AV_RB32
(
&
gdata
[
OMA_ENC_HEADER_SIZE
+
28
]);
av_log
(
s
,
AV_LOG_DEBUG
,
"RID: %.8
x
\n
"
,
oc
->
rid
);
av_log
(
s
,
AV_LOG_DEBUG
,
"RID: %.8
"
PRIx32
"
\n
"
,
oc
->
rid
);
memcpy
(
oc
->
iv
,
&
header
[
0x58
],
8
);
hex_log
(
s
,
AV_LOG_DEBUG
,
"IV"
,
oc
->
iv
,
8
);
...
...
@@ -372,7 +374,7 @@ static int oma_read_header(AVFormatContext *s)
channel_id
=
(
codec_params
>>
10
)
&
7
;
if
(
!
channel_id
)
{
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
;
}
st
->
codec
->
channel_layout
=
ff_oma_chid_to_native_layout
[
channel_id
-
1
];
...
...
libavformat/rmdec.c
View file @
d92024f1
...
...
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
...
...
@@ -269,7 +271,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
case
DEINT_ID_VBRF
:
break
;
default:
av_log
(
NULL
,
0
,
"Unknown interleaver %X
\n
"
,
ast
->
deint_id
);
av_log
(
NULL
,
0
,
"Unknown interleaver %"
PRIX32
"
\n
"
,
ast
->
deint_id
);
return
AVERROR_INVALIDDATA
;
}
...
...
libavformat/rpl.c
View file @
d92024f1
...
...
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <
stdint
.h>
#include <
inttypes
.h>
#include <stdlib.h>
#include "libavutil/avstring.h"
...
...
@@ -224,7 +224,7 @@ static int rpl_read_header(AVFormatContext *s)
}
if
(
ast
->
codec
->
codec_id
==
AV_CODEC_ID_NONE
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"RPL audio format %
i
not supported yet!
\n
"
,
"RPL audio format %
"
PRId32
"
not supported yet!
\n
"
,
audio_format
);
}
avpriv_set_pts_info
(
ast
,
32
,
1
,
ast
->
codec
->
bit_rate
);
...
...
libavformat/smacker.c
View file @
d92024f1
...
...
@@ -23,6 +23,8 @@
* Based on http://wiki.multimedia.cx/index.php?title=Smacker
*/
#include <inttypes.h>
#include "libavutil/bswap.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
...
...
@@ -139,7 +141,7 @@ static int smacker_read_header(AVFormatContext *s)
smk
->
pad
=
avio_rl32
(
pb
);
/* setup data */
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
-
1
;
}
smk
->
frm_size
=
av_malloc
(
smk
->
frames
*
4
);
...
...
@@ -214,7 +216,9 @@ static int smacker_read_header(AVFormatContext *s)
FF_INPUT_BUFFER_PADDING_SIZE
);
st
->
codec
->
extradata_size
=
smk
->
treesize
+
16
;
if
(
!
st
->
codec
->
extradata
){
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_free
(
smk
->
frm_size
);
av_free
(
smk
->
frm_flags
);
return
-
1
;
...
...
libavformat/smjpegdec.c
View file @
d92024f1
...
...
@@ -24,6 +24,8 @@
* This is a demuxer for Loki SDL Motion JPEG files
*/
#include <inttypes.h>
#include "avformat.h"
#include "internal.h"
#include "riff.h"
...
...
@@ -52,7 +54,7 @@ static int smjpeg_read_header(AVFormatContext *s)
avio_skip
(
pb
,
8
);
// magic
version
=
avio_rb32
(
pb
);
if
(
version
)
avpriv_request_sample
(
s
,
"Unknown version %
d"
,
version
);
avpriv_request_sample
(
s
,
"Unknown version %
"
PRIu32
,
version
);
duration
=
avio_rb32
(
pb
);
// in msec
...
...
@@ -124,7 +126,7 @@ static int smjpeg_read_header(AVFormatContext *s)
case
SMJPEG_HEND
:
return
0
;
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
;
}
}
...
...
@@ -164,7 +166,7 @@ static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
ret
=
AVERROR_EOF
;
break
;
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
;
break
;
}
...
...
libavformat/spdifenc.c
View file @
d92024f1
...
...
@@ -44,6 +44,8 @@
* dependent from data-type (spaces between packets are filled by zeros)
*/
#include <inttypes.h>
#include "avformat.h"
#include "avio_internal.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
"
);
return
AVERROR_INVALIDDATA
;
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
;
}
blocks
++
;
...
...
@@ -369,8 +371,8 @@ static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
ctx
->
data_type
=
IEC61937_MPEG2_AAC_LSF_4096
;
break
;
default:
av_log
(
s
,
AV_LOG_ERROR
,
"%i samples in AAC frame not supported
\n
"
,
hdr
.
samples
);
av_log
(
s
,
AV_LOG_ERROR
,
"%"
PRIu32
" samples in AAC frame not supported
\n
"
,
hdr
.
samples
);
return
AVERROR
(
EINVAL
);
}
//TODO Data type dependent info (LC profile/SBR)
...
...
libavformat/wtv.c
View file @
d92024f1
...
...
@@ -25,6 +25,8 @@
* @author Peter Ross <pross@xvid.org>
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
...
...
@@ -37,7 +39,7 @@
/* Macros for formating GUIDs */
#define PRI_PRETTY_GUID \
"%08
x-%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) \
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
...
...
@@ -501,7 +503,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
return
;
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
)
{
avio_get_str16le
(
pb
,
length
,
buf
,
buf_size
);
if
(
!
strlen
(
buf
))
{
...
...
libavformat/xmv.c
View file @
d92024f1
...
...
@@ -25,7 +25,7 @@
* Microsoft XMV demuxer
*/
#include <
stdint
.h>
#include <
inttypes
.h>
#include "libavutil/intreadwrite.h"
...
...
@@ -158,7 +158,7 @@ static int xmv_read_header(AVFormatContext *s)
file_version
=
avio_rl32
(
pb
);
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 */
...
...
@@ -228,7 +228,7 @@ static int xmv_read_header(AVFormatContext *s)
if
(
!
track
->
channels
||
!
track
->
sample_rate
||
track
->
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
);
ret
=
AVERROR_INVALIDDATA
;
goto
fail
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment