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
cc8163e1
Commit
cc8163e1
authored
Mar 13, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: more correct printf specifiers
parent
7513234b
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
172 additions
and
98 deletions
+172
-98
4xm.c
libavcodec/4xm.c
+3
-1
aic.c
libavcodec/aic.c
+3
-1
alac.c
libavcodec/alac.c
+6
-3
alsdec.c
libavcodec/alsdec.c
+7
-2
apedec.c
libavcodec/apedec.c
+4
-1
bmp.c
libavcodec/bmp.c
+15
-7
cllc.c
libavcodec/cllc.c
+3
-1
dfa.c
libavcodec/dfa.c
+4
-1
dxtory.c
libavcodec/dxtory.c
+19
-16
g2meet.c
libavcodec/g2meet.c
+10
-9
h264_ps.c
libavcodec/h264_ps.c
+7
-5
ivi_common.c
libavcodec/ivi_common.c
+4
-2
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+9
-6
lagarith.c
libavcodec/lagarith.c
+4
-2
metasound.c
libavcodec/metasound.c
+2
-1
mjpegbdec.c
libavcodec/mjpegbdec.c
+10
-7
mpeg12dec.c
libavcodec/mpeg12dec.c
+5
-2
mss12.c
libavcodec/mss12.c
+6
-4
rv10.c
libavcodec/rv10.c
+3
-2
svq3.c
libavcodec/svq3.c
+8
-5
truemotion2.c
libavcodec/truemotion2.c
+4
-1
tscc2.c
libavcodec/tscc2.c
+5
-2
utvideodec.c
libavcodec/utvideodec.c
+4
-2
wmalosslessdec.c
libavcodec/wmalosslessdec.c
+10
-6
wmaprodec.c
libavcodec/wmaprodec.c
+8
-4
xwddec.c
libavcodec/xwddec.c
+9
-5
No files found.
libavcodec/4xm.c
View file @
cc8163e1
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
* 4XM codec.
* 4XM codec.
*/
*/
#include <inttypes.h>
#include "libavutil/frame.h"
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
...
@@ -803,7 +805,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
...
@@ -803,7 +805,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
}
if
(
buf_size
<
AV_RL32
(
buf
+
4
)
+
8
)
{
if
(
buf_size
<
AV_RL32
(
buf
+
4
)
+
8
)
{
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"size mismatch %d %
d
\n
"
,
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"size mismatch %d %
"
PRIu32
"
\n
"
,
buf_size
,
AV_RL32
(
buf
+
4
));
buf_size
,
AV_RL32
(
buf
+
4
));
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
...
libavcodec/aic.c
View file @
cc8163e1
...
@@ -20,6 +20,8 @@
...
@@ -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 "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
#include "dsputil.h"
#include "dsputil.h"
...
@@ -169,7 +171,7 @@ static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
...
@@ -169,7 +171,7 @@ static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
width
=
AV_RB16
(
src
+
6
);
width
=
AV_RB16
(
src
+
6
);
height
=
AV_RB16
(
src
+
8
);
height
=
AV_RB16
(
src
+
8
);
if
(
frame_size
>
size
)
{
if
(
frame_size
>
size
)
{
av_log
(
ctx
->
avctx
,
AV_LOG_ERROR
,
"Frame size should be %
d
got %d
\n
"
,
av_log
(
ctx
->
avctx
,
AV_LOG_ERROR
,
"Frame size should be %
"
PRIu32
"
got %d
\n
"
,
frame_size
,
size
);
frame_size
,
size
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
...
libavcodec/alac.c
View file @
cc8163e1
...
@@ -45,6 +45,8 @@
...
@@ -45,6 +45,8 @@
* 32bit samplerate
* 32bit samplerate
*/
*/
#include <inttypes.h>
#include "libavutil/channel_layout.h"
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
...
@@ -276,7 +278,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
...
@@ -276,7 +278,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
else
else
output_samples
=
alac
->
max_samples_per_frame
;
output_samples
=
alac
->
max_samples_per_frame
;
if
(
!
output_samples
||
output_samples
>
alac
->
max_samples_per_frame
)
{
if
(
!
output_samples
||
output_samples
>
alac
->
max_samples_per_frame
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid samples per frame: %
d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid samples per frame: %
"
PRIu32
"
\n
"
,
output_samples
);
output_samples
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -288,7 +290,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
...
@@ -288,7 +290,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
return
ret
;
return
ret
;
}
}
}
else
if
(
output_samples
!=
alac
->
nb_samples
)
{
}
else
if
(
output_samples
!=
alac
->
nb_samples
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"sample count mismatch: %
u
!= %d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"sample count mismatch: %
"
PRIu32
"
!= %d
\n
"
,
output_samples
,
alac
->
nb_samples
);
output_samples
,
alac
->
nb_samples
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -500,7 +502,8 @@ static int alac_set_info(ALACContext *alac)
...
@@ -500,7 +502,8 @@ static int alac_set_info(ALACContext *alac)
alac
->
max_samples_per_frame
=
bytestream2_get_be32u
(
&
gb
);
alac
->
max_samples_per_frame
=
bytestream2_get_be32u
(
&
gb
);
if
(
!
alac
->
max_samples_per_frame
||
if
(
!
alac
->
max_samples_per_frame
||
alac
->
max_samples_per_frame
>
INT_MAX
/
sizeof
(
int32_t
))
{
alac
->
max_samples_per_frame
>
INT_MAX
/
sizeof
(
int32_t
))
{
av_log
(
alac
->
avctx
,
AV_LOG_ERROR
,
"max samples per frame invalid: %u
\n
"
,
av_log
(
alac
->
avctx
,
AV_LOG_ERROR
,
"max samples per frame invalid: %"
PRIu32
"
\n
"
,
alac
->
max_samples_per_frame
);
alac
->
max_samples_per_frame
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
...
libavcodec/alsdec.c
View file @
cc8163e1
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
* @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
*/
*/
#include <inttypes.h>
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
#include "unary.h"
#include "unary.h"
...
@@ -703,7 +705,9 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
...
@@ -703,7 +705,9 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
int
offset
=
parcor_rice_table
[
sconf
->
coef_table
][
k
][
0
];
int
offset
=
parcor_rice_table
[
sconf
->
coef_table
][
k
][
0
];
quant_cof
[
k
]
=
decode_rice
(
gb
,
rice_param
)
+
offset
;
quant_cof
[
k
]
=
decode_rice
(
gb
,
rice_param
)
+
offset
;
if
(
quant_cof
[
k
]
<
-
64
||
quant_cof
[
k
]
>
63
)
{
if
(
quant_cof
[
k
]
<
-
64
||
quant_cof
[
k
]
>
63
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"quant_cof %d is out of range
\n
"
,
quant_cof
[
k
]);
av_log
(
avctx
,
AV_LOG_ERROR
,
"quant_cof %"
PRIu32
" is out of range
\n
"
,
quant_cof
[
k
]);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
}
}
...
@@ -1378,7 +1382,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
...
@@ -1378,7 +1382,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
bd
.
block_length
=
div_blocks
[
b
];
bd
.
block_length
=
div_blocks
[
b
];
if
(
bd
.
block_length
<=
0
)
{
if
(
bd
.
block_length
<=
0
)
{
av_log
(
ctx
->
avctx
,
AV_LOG_WARNING
,
av_log
(
ctx
->
avctx
,
AV_LOG_WARNING
,
"Invalid block length %d in channel data!
\n
"
,
bd
.
block_length
);
"Invalid block length %u in channel data!
\n
"
,
bd
.
block_length
);
continue
;
continue
;
}
}
...
...
libavcodec/apedec.c
View file @
cc8163e1
...
@@ -20,6 +20,8 @@
...
@@ -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/avassert.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/opt.h"
...
@@ -1456,7 +1458,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1456,7 +1458,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
}
}
if
(
!
nblocks
||
nblocks
>
INT_MAX
)
{
if
(
!
nblocks
||
nblocks
>
INT_MAX
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid sample count: %u.
\n
"
,
nblocks
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid sample count: %"
PRIu32
".
\n
"
,
nblocks
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
s
->
samples
=
nblocks
;
s
->
samples
=
nblocks
;
...
...
libavcodec/bmp.c
View file @
cc8163e1
...
@@ -19,6 +19,8 @@
...
@@ -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 "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
#include "bmp.h"
#include "bmp.h"
...
@@ -57,7 +59,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
...
@@ -57,7 +59,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
fsize
=
bytestream_get_le32
(
&
buf
);
fsize
=
bytestream_get_le32
(
&
buf
);
if
(
buf_size
<
fsize
)
{
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
);
buf_size
,
fsize
);
fsize
=
buf_size
;
fsize
=
buf_size
;
}
}
...
@@ -68,7 +70,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
...
@@ -68,7 +70,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
hsize
=
bytestream_get_le32
(
&
buf
);
/* header size */
hsize
=
bytestream_get_le32
(
&
buf
);
/* header size */
ihsize
=
bytestream_get_le32
(
&
buf
);
/* more header size */
ihsize
=
bytestream_get_le32
(
&
buf
);
/* more header size */
if
(
ihsize
+
14
>
hsize
)
{
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
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -77,7 +79,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
...
@@ -77,7 +79,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
fsize
=
buf_size
-
2
;
fsize
=
buf_size
-
2
;
if
(
fsize
<=
hsize
)
{
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
);
fsize
,
hsize
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -163,7 +166,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
...
@@ -163,7 +166,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
else
if
(
rgb
[
0
]
==
0x0F00
&&
rgb
[
1
]
==
0x00F0
&&
rgb
[
2
]
==
0x000F
)
else
if
(
rgb
[
0
]
==
0x0F00
&&
rgb
[
1
]
==
0x00F0
&&
rgb
[
2
]
==
0x000F
)
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB444
;
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB444
;
else
{
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
);
return
AVERROR
(
EINVAL
);
}
}
}
}
...
@@ -179,12 +184,13 @@ static int bmp_decode_frame(AVCodecContext *avctx,
...
@@ -179,12 +184,13 @@ static int bmp_decode_frame(AVCodecContext *avctx,
if
(
hsize
-
ihsize
-
14
>
0
)
{
if
(
hsize
-
ihsize
-
14
>
0
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_PAL8
;
avctx
->
pix_fmt
=
AV_PIX_FMT_PAL8
;
}
else
{
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown palette for %d-colour BMP
\n
"
,
1
<<
depth
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown palette for %u-colour BMP
\n
"
,
1
<<
depth
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
break
;
break
;
default:
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"depth %
d
not supported
\n
"
,
depth
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"depth %
u
not supported
\n
"
,
depth
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -234,7 +240,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
...
@@ -234,7 +240,9 @@ static int bmp_decode_frame(AVCodecContext *avctx,
buf
=
buf0
+
46
;
buf
=
buf0
+
46
;
t
=
bytestream_get_le32
(
&
buf
);
t
=
bytestream_get_le32
(
&
buf
);
if
(
t
<
0
||
t
>
(
1
<<
depth
))
{
if
(
t
<
0
||
t
>
(
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
)
{
}
else
if
(
t
)
{
colors
=
t
;
colors
=
t
;
}
}
...
...
libavcodec/cllc.c
View file @
cc8163e1
...
@@ -20,6 +20,8 @@
...
@@ -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 "dsputil.h"
#include "dsputil.h"
#include "get_bits.h"
#include "get_bits.h"
...
@@ -367,7 +369,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -367,7 +369,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
info_offset
=
AV_RL32
(
src
+
4
);
info_offset
=
AV_RL32
(
src
+
4
);
if
(
info_offset
>
UINT32_MAX
-
8
||
info_offset
+
8
>
avpkt
->
size
)
{
if
(
info_offset
>
UINT32_MAX
-
8
||
info_offset
+
8
>
avpkt
->
size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid INFO header offset: 0x%08
X
is too large.
\n
"
,
"Invalid INFO header offset: 0x%08
"
PRIX32
"
is too large.
\n
"
,
info_offset
);
info_offset
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
...
libavcodec/dfa.c
View file @
cc8163e1
...
@@ -20,6 +20,8 @@
...
@@ -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 "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
#include "internal.h"
#include "internal.h"
...
@@ -363,7 +365,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
...
@@ -363,7 +365,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
}
else
{
}
else
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Ignoring unknown chunk type %d
\n
"
,
av_log
(
avctx
,
AV_LOG_WARNING
,
"Ignoring unknown chunk type %"
PRIu32
"
\n
"
,
chunk_type
);
chunk_type
);
}
}
buf
+=
chunk_size
;
buf
+=
chunk_size
;
...
...
libavcodec/dxtory.c
View file @
cc8163e1
...
@@ -20,6 +20,8 @@
...
@@ -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>
#define BITSTREAM_READER_LE
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
...
@@ -269,18 +271,18 @@ static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
...
@@ -269,18 +271,18 @@ static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
slice_size
=
bytestream2_get_le32
(
&
gb
);
slice_size
=
bytestream2_get_le32
(
&
gb
);
if
(
slice_size
>
src_size
-
off
)
{
if
(
slice_size
>
src_size
-
off
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
slice_size
,
src_size
-
off
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
slice_size
<=
16
)
{
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
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
AV_RL32
(
src
+
off
),
slice_size
-
16
);
}
}
init_get_bits
(
&
gb2
,
src
+
off
+
16
,
(
slice_size
-
16
)
*
8
);
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,
...
@@ -350,18 +352,19 @@ static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
slice_size
=
bytestream2_get_le32
(
&
gb
);
slice_size
=
bytestream2_get_le32
(
&
gb
);
if
(
slice_size
>
src_size
-
off
)
{
if
(
slice_size
>
src_size
-
off
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
slice_size
,
src_size
-
off
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
slice_size
<=
16
)
{
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
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
AV_RL32
(
src
+
off
),
slice_size
-
16
);
}
}
init_get_bits
(
&
gb2
,
src
+
off
+
16
,
(
slice_size
-
16
)
*
8
);
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,
...
@@ -448,18 +451,18 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
slice_height
=
(
next_y
&
~
3
)
-
(
cur_y
&
~
3
);
slice_height
=
(
next_y
&
~
3
)
-
(
cur_y
&
~
3
);
if
(
slice_size
>
src_size
-
off
)
{
if
(
slice_size
>
src_size
-
off
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
slice_size
,
src_size
-
off
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
slice_size
<=
16
)
{
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
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
AV_RL32
(
src
+
off
),
slice_size
-
16
);
}
}
init_get_bits
(
&
gb2
,
src
+
off
+
16
,
(
slice_size
-
16
)
*
8
);
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,
...
@@ -552,18 +555,18 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
slice_height
=
(
next_y
&
~
1
)
-
(
cur_y
&
~
1
);
slice_height
=
(
next_y
&
~
1
)
-
(
cur_y
&
~
1
);
if
(
slice_size
>
src_size
-
off
)
{
if
(
slice_size
>
src_size
-
off
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
slice_size
,
src_size
-
off
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
slice_size
<=
16
)
{
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
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
AV_RL32
(
src
+
off
),
slice_size
-
16
);
}
}
init_get_bits
(
&
gb2
,
src
+
off
+
16
,
(
slice_size
-
16
)
*
8
);
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,
...
@@ -645,18 +648,18 @@ static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic,
slice_size
=
bytestream2_get_le32
(
&
gb
);
slice_size
=
bytestream2_get_le32
(
&
gb
);
if
(
slice_size
>
src_size
-
off
)
{
if
(
slice_size
>
src_size
-
off
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
slice_size
,
src_size
-
off
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
slice_size
<=
16
)
{
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
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
if
(
AV_RL32
(
src
+
off
)
!=
slice_size
-
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
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
);
AV_RL32
(
src
+
off
),
slice_size
-
16
);
}
}
init_get_bits
(
&
gb2
,
src
+
off
+
16
,
(
slice_size
-
16
)
*
8
);
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,
...
@@ -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
);
ret
=
dxtory_decode_v2_565
(
avctx
,
pic
,
src
+
16
,
avpkt
->
size
-
16
,
0
);
break
;
break
;
default:
default:
avpriv_request_sample
(
avctx
,
"Frame header %
X"
,
AV_RB32
(
src
));
avpriv_request_sample
(
avctx
,
"Frame header %
"
PRIX32
,
AV_RB32
(
src
));
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
...
...
libavcodec/g2meet.c
View file @
cc8163e1
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
* Go2Webinar decoder
* Go2Webinar decoder
*/
*/
#include <inttypes.h>
#include <zlib.h>
#include <zlib.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
...
@@ -500,19 +501,19 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
...
@@ -500,19 +501,19 @@ static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
if
(
cursor_w
<
1
||
cursor_w
>
256
||
if
(
cursor_w
<
1
||
cursor_w
>
256
||
cursor_h
<
1
||
cursor_h
>
256
)
{
cursor_h
<
1
||
cursor_h
>
256
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor dimensions %
dx%d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor dimensions %
"
PRIu32
"x%"
PRIu32
"
\n
"
,
cursor_w
,
cursor_h
);
cursor_w
,
cursor_h
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
cursor_hot_x
>
cursor_w
||
cursor_hot_y
>
cursor_h
)
{
if
(
cursor_hot_x
>
cursor_w
||
cursor_hot_y
>
cursor_h
)
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Invalid hotspot position %
d,%d
\n
"
,
av_log
(
avctx
,
AV_LOG_WARNING
,
"Invalid hotspot position %
"
PRIu32
",%"
PRIu32
"
\n
"
,
cursor_hot_x
,
cursor_hot_y
);
cursor_hot_x
,
cursor_hot_y
);
cursor_hot_x
=
FFMIN
(
cursor_hot_x
,
cursor_w
-
1
);
cursor_hot_x
=
FFMIN
(
cursor_hot_x
,
cursor_w
-
1
);
cursor_hot_y
=
FFMIN
(
cursor_hot_y
,
cursor_h
-
1
);
cursor_hot_y
=
FFMIN
(
cursor_hot_y
,
cursor_h
-
1
);
}
}
if
(
cur_size
-
9
>
bytestream2_get_bytes_left
(
gb
)
||
if
(
cur_size
-
9
>
bytestream2_get_bytes_left
(
gb
)
||
c
->
cursor_w
*
c
->
cursor_h
/
4
>
cur_size
)
{
c
->
cursor_w
*
c
->
cursor_h
/
4
>
cur_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor data size %
d/%d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor data size %
"
PRIu32
"/%u
\n
"
,
cur_size
,
bytestream2_get_bytes_left
(
gb
));
cur_size
,
bytestream2_get_bytes_left
(
gb
));
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -692,7 +693,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -692,7 +693,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
chunk_type
=
bytestream2_get_byte
(
&
bc
);
chunk_type
=
bytestream2_get_byte
(
&
bc
);
chunk_start
=
bytestream2_tell
(
&
bc
);
chunk_start
=
bytestream2_tell
(
&
bc
);
if
(
chunk_size
>
bytestream2_get_bytes_left
(
&
bc
))
{
if
(
chunk_size
>
bytestream2_get_bytes_left
(
&
bc
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid chunk size %
d
type %02X
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid chunk size %
"
PRIu32
"
type %02X
\n
"
,
chunk_size
,
chunk_type
);
chunk_size
,
chunk_type
);
break
;
break
;
}
}
...
@@ -700,7 +701,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -700,7 +701,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
case
DISPLAY_INFO
:
case
DISPLAY_INFO
:
c
->
got_header
=
0
;
c
->
got_header
=
0
;
if
(
chunk_size
<
21
)
{
if
(
chunk_size
<
21
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid display info size %
d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid display info size %
"
PRIu32
"
\n
"
,
chunk_size
);
chunk_size
);
break
;
break
;
}
}
...
@@ -748,7 +749,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -748,7 +749,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
b_mask
=
bytestream2_get_be32
(
&
bc
);
b_mask
=
bytestream2_get_be32
(
&
bc
);
if
(
r_mask
!=
0xFF0000
||
g_mask
!=
0xFF00
||
b_mask
!=
0xFF
)
{
if
(
r_mask
!=
0xFF0000
||
g_mask
!=
0xFF00
||
b_mask
!=
0xFF
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid or unsupported bitmasks: R=%
X, G=%X, B=%X
\n
"
,
"Invalid or unsupported bitmasks: R=%
"
PRIX32
", G=%"
PRIX32
", B=%"
PRIX32
"
\n
"
,
r_mask
,
g_mask
,
b_mask
);
r_mask
,
g_mask
,
b_mask
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
...
@@ -799,7 +800,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -799,7 +800,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
break
;
break
;
case
CURSOR_POS
:
case
CURSOR_POS
:
if
(
chunk_size
<
5
)
{
if
(
chunk_size
<
5
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor pos size %
d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor pos size %
"
PRIu32
"
\n
"
,
chunk_size
);
chunk_size
);
break
;
break
;
}
}
...
@@ -808,7 +809,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -808,7 +809,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
break
;
break
;
case
CURSOR_SHAPE
:
case
CURSOR_SHAPE
:
if
(
chunk_size
<
8
)
{
if
(
chunk_size
<
8
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor data size %
d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid cursor data size %
"
PRIu32
"
\n
"
,
chunk_size
);
chunk_size
);
break
;
break
;
}
}
...
@@ -820,7 +821,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -820,7 +821,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
case
CHUNK_CD
:
case
CHUNK_CD
:
break
;
break
;
default:
default:
av_log
(
avctx
,
AV_LOG_WARNING
,
"Skipping chunk type %02
X
\n
"
,
av_log
(
avctx
,
AV_LOG_WARNING
,
"Skipping chunk type %02
"
PRIX32
"
\n
"
,
chunk_type
);
chunk_type
);
}
}
...
...
libavcodec/h264_ps.c
View file @
cc8163e1
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* @author Michael Niedermayer <michaelni@gmx.at>
* @author Michael Niedermayer <michaelni@gmx.at>
*/
*/
#include <inttypes.h>
#include "libavutil/imgutils.h"
#include "libavutil/imgutils.h"
#include "internal.h"
#include "internal.h"
#include "avcodec.h"
#include "avcodec.h"
...
@@ -186,7 +188,7 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
...
@@ -186,7 +188,7 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
sps
->
time_scale
=
get_bits_long
(
&
h
->
gb
,
32
);
sps
->
time_scale
=
get_bits_long
(
&
h
->
gb
,
32
);
if
(
!
sps
->
num_units_in_tick
||
!
sps
->
time_scale
)
{
if
(
!
sps
->
num_units_in_tick
||
!
sps
->
time_scale
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"time_scale/num_units_in_tick invalid or unsupported (%
d/%d
)
\n
"
,
"time_scale/num_units_in_tick invalid or unsupported (%
"
PRIu32
"/%"
PRIu32
"
)
\n
"
,
sps
->
time_scale
,
sps
->
num_units_in_tick
);
sps
->
time_scale
,
sps
->
num_units_in_tick
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -388,7 +390,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
...
@@ -388,7 +390,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
if
((
unsigned
)
sps
->
poc_cycle_length
>=
if
((
unsigned
)
sps
->
poc_cycle_length
>=
FF_ARRAY_ELEMS
(
sps
->
offset_for_ref_frame
))
{
FF_ARRAY_ELEMS
(
sps
->
offset_for_ref_frame
))
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"poc_cycle_length overflow %
u
\n
"
,
sps
->
poc_cycle_length
);
"poc_cycle_length overflow %
d
\n
"
,
sps
->
poc_cycle_length
);
goto
fail
;
goto
fail
;
}
}
...
@@ -444,7 +446,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
...
@@ -444,7 +446,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
if
(
h
->
avctx
->
flags2
&
CODEC_FLAG2_IGNORE_CROP
)
{
if
(
h
->
avctx
->
flags2
&
CODEC_FLAG2_IGNORE_CROP
)
{
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
"discarding sps cropping, original "
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
"discarding sps cropping, original "
"values are l:%
u r:%u t:%u b:%u
\n
"
,
"values are l:%
d r:%d t:%d b:%d
\n
"
,
crop_left
,
crop_right
,
crop_top
,
crop_bottom
);
crop_left
,
crop_right
,
crop_top
,
crop_bottom
);
sps
->
crop_left
=
sps
->
crop_left
=
...
@@ -493,7 +495,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
...
@@ -493,7 +495,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
if
(
h
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
if
(
h
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
static
const
char
csp
[
4
][
5
]
=
{
"Gray"
,
"420"
,
"422"
,
"444"
};
static
const
char
csp
[
4
][
5
]
=
{
"Gray"
,
"420"
,
"422"
,
"444"
};
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
"sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%
d/%d/%d/%d
%s %s %d/%d
\n
"
,
"sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%
u/%u/%u/%u
%s %s %d/%d
\n
"
,
sps_id
,
sps
->
profile_idc
,
sps
->
level_idc
,
sps_id
,
sps
->
profile_idc
,
sps
->
level_idc
,
sps
->
poc_type
,
sps
->
poc_type
,
sps
->
ref_frame_count
,
sps
->
ref_frame_count
,
...
@@ -639,7 +641,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
...
@@ -639,7 +641,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
if
(
h
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
if
(
h
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
"pps:%u sps:%u %s slice_groups:%d ref:%
d/%d
%s qp:%d/%d/%d/%d %s %s %s %s
\n
"
,
"pps:%u sps:%u %s slice_groups:%d ref:%
u/%u
%s qp:%d/%d/%d/%d %s %s %s %s
\n
"
,
pps_id
,
pps
->
sps_id
,
pps_id
,
pps
->
sps_id
,
pps
->
cabac
?
"CABAC"
:
"CAVLC"
,
pps
->
cabac
?
"CABAC"
:
"CAVLC"
,
pps
->
slice_group_count
,
pps
->
slice_group_count
,
...
...
libavcodec/ivi_common.c
View file @
cc8163e1
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
* Indeo5 decoders.
* Indeo5 decoders.
*/
*/
#include <inttypes.h>
#define BITSTREAM_READER_LE
#define BITSTREAM_READER_LE
#include "libavutil/attributes.h"
#include "libavutil/attributes.h"
#include "libavutil/timer.h"
#include "libavutil/timer.h"
...
@@ -514,7 +516,7 @@ static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
...
@@ -514,7 +516,7 @@ static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
val
=
IVI_TOSIGNED
((
hi
<<
6
)
|
lo
);
val
=
IVI_TOSIGNED
((
hi
<<
6
)
|
lo
);
}
else
{
}
else
{
if
(
sym
>=
256U
)
{
if
(
sym
>=
256U
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid sym encountered: %
d
.
\n
"
,
sym
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid sym encountered: %
"
PRIu32
"
.
\n
"
,
sym
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
run
=
rvmap
->
runtab
[
sym
];
run
=
rvmap
->
runtab
[
sym
];
...
@@ -933,7 +935,7 @@ static int decode_band(IVI45DecContext *ctx,
...
@@ -933,7 +935,7 @@ static int decode_band(IVI45DecContext *ctx,
if
(
chksum
!=
band
->
checksum
)
{
if
(
chksum
!=
band
->
checksum
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Band checksum mismatch! Plane %d, band %d, "
"Band checksum mismatch! Plane %d, band %d, "
"received: %
x, calculated: %x
\n
"
,
"received: %
"
PRIx32
", calculated: %"
PRIx16
"
\n
"
,
band
->
plane
,
band
->
band_num
,
band
->
checksum
,
chksum
);
band
->
plane
,
band
->
band_num
,
band
->
checksum
,
chksum
);
}
}
}
}
...
...
libavcodec/jpeg2000dec.c
View file @
cc8163e1
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* JPEG 2000 image decoder
* JPEG 2000 image decoder
*/
*/
#include <inttypes.h>
#include "libavutil/common.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "avcodec.h"
...
@@ -345,7 +347,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
...
@@ -345,7 +347,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
if
(
tmp
.
mct
&&
s
->
ncomponents
<
3
)
{
if
(
tmp
.
mct
&&
s
->
ncomponents
<
3
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"MCT %
d
with too few components (%d)
\n
"
,
"MCT %
"
PRIu8
"
with too few components (%d)
\n
"
,
tmp
.
mct
,
s
->
ncomponents
);
tmp
.
mct
,
s
->
ncomponents
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -497,12 +499,12 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
...
@@ -497,12 +499,12 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
bytestream2_get_byteu
(
&
s
->
g
);
// TNsot
bytestream2_get_byteu
(
&
s
->
g
);
// TNsot
if
(
Psot
>
bytestream2_get_bytes_left
(
&
s
->
g
)
+
n
+
2
)
{
if
(
Psot
>
bytestream2_get_bytes_left
(
&
s
->
g
)
+
n
+
2
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Psot %
d
too big
\n
"
,
Psot
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Psot %
"
PRIu32
"
too big
\n
"
,
Psot
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
TPsot
>=
FF_ARRAY_ELEMS
(
s
->
tile
[
Isot
].
tile_part
))
{
if
(
TPsot
>=
FF_ARRAY_ELEMS
(
s
->
tile
[
Isot
].
tile_part
))
{
avpriv_request_sample
(
s
->
avctx
,
"Support for %
d
components"
,
TPsot
);
avpriv_request_sample
(
s
->
avctx
,
"Support for %
"
PRIu8
"
components"
,
TPsot
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
...
@@ -718,7 +720,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
...
@@ -718,7 +720,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
if
(
cblk
->
length
>
sizeof
(
cblk
->
data
))
{
if
(
cblk
->
length
>
sizeof
(
cblk
->
data
))
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Block length %
d
> data size %zd
\n
"
,
"Block length %
"
PRIu16
"
> data size %zd
\n
"
,
cblk
->
length
,
sizeof
(
cblk
->
data
));
cblk
->
length
,
sizeof
(
cblk
->
data
));
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -1343,14 +1345,15 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
...
@@ -1343,14 +1345,15 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
break
;
break
;
default:
default:
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"unsupported marker 0x%.4
X
at pos 0x%X
\n
"
,
"unsupported marker 0x%.4
"
PRIX16
"
at pos 0x%X
\n
"
,
marker
,
bytestream2_tell
(
&
s
->
g
)
-
4
);
marker
,
bytestream2_tell
(
&
s
->
g
)
-
4
);
bytestream2_skip
(
&
s
->
g
,
len
-
2
);
bytestream2_skip
(
&
s
->
g
,
len
-
2
);
break
;
break
;
}
}
if
(
bytestream2_tell
(
&
s
->
g
)
-
oldpos
!=
len
||
ret
)
{
if
(
bytestream2_tell
(
&
s
->
g
)
-
oldpos
!=
len
||
ret
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"error during processing marker segment %.4x
\n
"
,
marker
);
"error during processing marker segment %.4"
PRIx16
"
\n
"
,
marker
);
return
ret
?
ret
:
-
1
;
return
ret
?
ret
:
-
1
;
}
}
}
}
...
...
libavcodec/lagarith.c
View file @
cc8163e1
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* @author Nathan Caldwell
* @author Nathan Caldwell
*/
*/
#include <inttypes.h>
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
#include "mathops.h"
#include "mathops.h"
...
@@ -449,7 +451,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
...
@@ -449,7 +451,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
if
(
read
>
length
)
if
(
read
>
length
)
av_log
(
l
->
avctx
,
AV_LOG_WARNING
,
av_log
(
l
->
avctx
,
AV_LOG_WARNING
,
"Output more bytes than length (%d of %
d
)
\n
"
,
read
,
"Output more bytes than length (%d of %
"
PRIu32
"
)
\n
"
,
read
,
length
);
length
);
}
else
if
(
esc_count
<
8
)
{
}
else
if
(
esc_count
<
8
)
{
esc_count
-=
4
;
esc_count
-=
4
;
...
@@ -666,7 +668,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
...
@@ -666,7 +668,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
break
;
break
;
default:
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported Lagarith frame type: %#
x
\n
"
,
frametype
);
"Unsupported Lagarith frame type: %#
"
PRIu8
"
\n
"
,
frametype
);
return
-
1
;
return
-
1
;
}
}
...
...
libavcodec/metasound.c
View file @
cc8163e1
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,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 <math.h>
#include <math.h>
#include <stdint.h>
#include <stdint.h>
...
@@ -283,7 +284,7 @@ static av_cold int metasound_decode_init(AVCodecContext *avctx)
...
@@ -283,7 +284,7 @@ static av_cold int metasound_decode_init(AVCodecContext *avctx)
for
(;;)
{
for
(;;)
{
if
(
!
props
->
tag
)
{
if
(
!
props
->
tag
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not find tag %08
X
\n
"
,
tag
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not find tag %08
"
PRIX32
"
\n
"
,
tag
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
props
->
tag
==
tag
)
{
if
(
props
->
tag
==
tag
)
{
...
...
libavcodec/mjpegbdec.c
View file @
cc8163e1
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
* Apple MJPEG-B decoder.
* Apple MJPEG-B decoder.
*/
*/
#include <inttypes.h>
#include "avcodec.h"
#include "avcodec.h"
#include "mjpeg.h"
#include "mjpeg.h"
#include "mjpegdec.h"
#include "mjpegdec.h"
...
@@ -73,13 +75,14 @@ read_header:
...
@@ -73,13 +75,14 @@ read_header:
}
}
field_size
=
get_bits_long
(
&
hgb
,
32
);
/* field size */
field_size
=
get_bits_long
(
&
hgb
,
32
);
/* field size */
av_log
(
avctx
,
AV_LOG_DEBUG
,
"field size: 0x%
x
\n
"
,
field_size
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"field size: 0x%
"
PRIx32
"
\n
"
,
field_size
);
skip_bits
(
&
hgb
,
32
);
/* padded field size */
skip_bits
(
&
hgb
,
32
);
/* padded field size */
second_field_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"second_field_offs is %d and size is %d
\n
"
);
second_field_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"second_field_offs is %d and size is %d
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"second field offs: 0x%x
\n
"
,
second_field_offs
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"second field offs: 0x%"
PRIx32
"
\n
"
,
second_field_offs
);
dqt_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"dqt is %d and size is %d
\n
"
);
dqt_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"dqt is %d and size is %d
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"dqt offs: 0x%
x
\n
"
,
dqt_offs
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"dqt offs: 0x%
"
PRIx32
"
\n
"
,
dqt_offs
);
if
(
dqt_offs
)
if
(
dqt_offs
)
{
{
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
dqt_offs
,
(
buf_end
-
(
buf_ptr
+
dqt_offs
))
*
8
);
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
dqt_offs
,
(
buf_end
-
(
buf_ptr
+
dqt_offs
))
*
8
);
...
@@ -90,7 +93,7 @@ read_header:
...
@@ -90,7 +93,7 @@ read_header:
}
}
dht_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"dht is %d and size is %d
\n
"
);
dht_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"dht is %d and size is %d
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"dht offs: 0x%
x
\n
"
,
dht_offs
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"dht offs: 0x%
"
PRIx32
"
\n
"
,
dht_offs
);
if
(
dht_offs
)
if
(
dht_offs
)
{
{
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
dht_offs
,
(
buf_end
-
(
buf_ptr
+
dht_offs
))
*
8
);
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
dht_offs
,
(
buf_end
-
(
buf_ptr
+
dht_offs
))
*
8
);
...
@@ -99,7 +102,7 @@ read_header:
...
@@ -99,7 +102,7 @@ read_header:
}
}
sof_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"sof is %d and size is %d
\n
"
);
sof_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"sof is %d and size is %d
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"sof offs: 0x%
x
\n
"
,
sof_offs
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"sof offs: 0x%
"
PRIx32
"
\n
"
,
sof_offs
);
if
(
sof_offs
)
if
(
sof_offs
)
{
{
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
sof_offs
,
(
buf_end
-
(
buf_ptr
+
sof_offs
))
*
8
);
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
sof_offs
,
(
buf_end
-
(
buf_ptr
+
sof_offs
))
*
8
);
...
@@ -109,9 +112,9 @@ read_header:
...
@@ -109,9 +112,9 @@ read_header:
}
}
sos_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"sos is %d and size is %d
\n
"
);
sos_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"sos is %d and size is %d
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"sos offs: 0x%
x
\n
"
,
sos_offs
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"sos offs: 0x%
"
PRIx32
"
\n
"
,
sos_offs
);
sod_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"sof is %d and size is %d
\n
"
);
sod_offs
=
read_offs
(
avctx
,
&
hgb
,
buf_end
-
buf_ptr
,
"sof is %d and size is %d
\n
"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"sod offs: 0x%
x
\n
"
,
sod_offs
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"sod offs: 0x%
"
PRIx32
"
\n
"
,
sod_offs
);
if
(
sos_offs
)
if
(
sos_offs
)
{
{
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
sos_offs
,
init_get_bits
(
&
s
->
gb
,
buf_ptr
+
sos_offs
,
...
...
libavcodec/mpeg12dec.c
View file @
cc8163e1
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* MPEG-1/2 decoder
* MPEG-1/2 decoder
*/
*/
#include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
#include "libavutil/internal.h"
#include "libavutil/stereo3d.h"
#include "libavutil/stereo3d.h"
...
@@ -1452,7 +1454,8 @@ static void mpeg_decode_picture_display_extension(Mpeg1Context *s1)
...
@@ -1452,7 +1454,8 @@ static void mpeg_decode_picture_display_extension(Mpeg1Context *s1)
}
}
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"pde (%d,%d) (%d,%d) (%d,%d)
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"pde (%"
PRId16
",%"
PRId16
") (%"
PRId16
",%"
PRId16
") (%"
PRId16
",%"
PRId16
")
\n
"
,
s1
->
pan_scan
.
position
[
0
][
0
],
s1
->
pan_scan
.
position
[
0
][
1
],
s1
->
pan_scan
.
position
[
0
][
0
],
s1
->
pan_scan
.
position
[
0
][
1
],
s1
->
pan_scan
.
position
[
1
][
0
],
s1
->
pan_scan
.
position
[
1
][
1
],
s1
->
pan_scan
.
position
[
1
][
0
],
s1
->
pan_scan
.
position
[
1
][
1
],
s1
->
pan_scan
.
position
[
2
][
0
],
s1
->
pan_scan
.
position
[
2
][
1
]);
s1
->
pan_scan
.
position
[
2
][
0
],
s1
->
pan_scan
.
position
[
2
][
1
]);
...
@@ -2343,7 +2346,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
...
@@ -2343,7 +2346,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
input_size
=
buf_end
-
buf_ptr
;
input_size
=
buf_end
-
buf_ptr
;
if
(
avctx
->
debug
&
FF_DEBUG_STARTCODE
)
if
(
avctx
->
debug
&
FF_DEBUG_STARTCODE
)
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%3
X
at %td left %d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%3
"
PRIX32
"
at %td left %d
\n
"
,
start_code
,
buf_ptr
-
buf
,
input_size
);
start_code
,
buf_ptr
-
buf
,
input_size
);
/* prepare data for next start code */
/* prepare data for next start code */
...
...
libavcodec/mss12.c
View file @
cc8163e1
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
* Common functions for Microsoft Screen 1 and 2
* Common functions for Microsoft Screen 1 and 2
*/
*/
#include <inttypes.h>
#include "libavutil/intfloat.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "avcodec.h"
...
@@ -573,7 +575,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
...
@@ -573,7 +575,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
if
(
AV_RB32
(
avctx
->
extradata
)
<
avctx
->
extradata_size
)
{
if
(
AV_RB32
(
avctx
->
extradata
)
<
avctx
->
extradata_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Insufficient extradata size: expected %
d
got %d
\n
"
,
"Insufficient extradata size: expected %
"
PRIu32
"
got %d
\n
"
,
AV_RB32
(
avctx
->
extradata
),
AV_RB32
(
avctx
->
extradata
),
avctx
->
extradata_size
);
avctx
->
extradata_size
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -587,7 +589,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
...
@@ -587,7 +589,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Encoder version %
d.%d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Encoder version %
"
PRIu32
".%"
PRIu32
"
\n
"
,
AV_RB32
(
avctx
->
extradata
+
4
),
AV_RB32
(
avctx
->
extradata
+
8
));
AV_RB32
(
avctx
->
extradata
+
4
),
AV_RB32
(
avctx
->
extradata
+
8
));
if
(
version
!=
AV_RB32
(
avctx
->
extradata
+
4
)
>
1
)
{
if
(
version
!=
AV_RB32
(
avctx
->
extradata
+
4
)
>
1
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
@@ -604,13 +606,13 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
...
@@ -604,13 +606,13 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
}
}
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%d free colour(s)
\n
"
,
c
->
free_colours
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%d free colour(s)
\n
"
,
c
->
free_colours
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Display dimensions %
dx%d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Display dimensions %
"
PRIu32
"x%"
PRIu32
"
\n
"
,
AV_RB32
(
avctx
->
extradata
+
12
),
AV_RB32
(
avctx
->
extradata
+
16
));
AV_RB32
(
avctx
->
extradata
+
12
),
AV_RB32
(
avctx
->
extradata
+
16
));
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Coded dimensions %dx%d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Coded dimensions %dx%d
\n
"
,
avctx
->
coded_width
,
avctx
->
coded_height
);
avctx
->
coded_width
,
avctx
->
coded_height
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%g frames per second
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%g frames per second
\n
"
,
av_int2float
(
AV_RB32
(
avctx
->
extradata
+
28
)));
av_int2float
(
AV_RB32
(
avctx
->
extradata
+
28
)));
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Bitrate %
d
bps
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Bitrate %
"
PRIu32
"
bps
\n
"
,
AV_RB32
(
avctx
->
extradata
+
32
));
AV_RB32
(
avctx
->
extradata
+
32
));
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Max. lead time %g ms
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Max. lead time %g ms
\n
"
,
av_int2float
(
AV_RB32
(
avctx
->
extradata
+
36
)));
av_int2float
(
AV_RB32
(
avctx
->
extradata
+
36
)));
...
...
libavcodec/rv10.c
View file @
cc8163e1
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* RV10/RV20 decoder
* RV10/RV20 decoder
*/
*/
#include <inttypes.h>
#include "libavutil/imgutils.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "avcodec.h"
...
@@ -489,8 +491,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
...
@@ -489,8 +491,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
if
(
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
if
(
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
{
av_log
(
avctx
,
AV_LOG_DEBUG
,
"ver:%X ver0:%X
\n
"
,
rv
->
sub_id
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"ver:%X ver0:%X
\n
"
,
rv
->
sub_id
,
avctx
->
extradata_size
>=
4
?
((
uint32_t
*
)
avctx
->
extradata
)[
0
]
avctx
->
extradata_size
>=
4
?
((
int
*
)
avctx
->
extradata
)[
0
]
:
-
1
);
:
-
1
);
}
}
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
...
...
libavcodec/svq3.c
View file @
cc8163e1
...
@@ -40,6 +40,8 @@
...
@@ -40,6 +40,8 @@
* http://samples.libav.org/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
* http://samples.libav.org/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
*/
*/
#include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/attributes.h"
#include "internal.h"
#include "internal.h"
#include "avcodec.h"
#include "avcodec.h"
...
@@ -614,7 +616,8 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
...
@@ -614,7 +616,8 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
vlc
=
svq3_get_ue_golomb
(
&
h
->
gb
);
vlc
=
svq3_get_ue_golomb
(
&
h
->
gb
);
if
(
vlc
>=
25
)
{
if
(
vlc
>=
25
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"luma prediction:%d
\n
"
,
vlc
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"luma prediction:%"
PRIu32
"
\n
"
,
vlc
);
return
-
1
;
return
-
1
;
}
}
...
@@ -683,7 +686,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
...
@@ -683,7 +686,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
if
(
!
IS_INTRA16x16
(
mb_type
)
&&
if
(
!
IS_INTRA16x16
(
mb_type
)
&&
(
!
IS_SKIP
(
mb_type
)
||
h
->
pict_type
==
AV_PICTURE_TYPE_B
))
{
(
!
IS_SKIP
(
mb_type
)
||
h
->
pict_type
==
AV_PICTURE_TYPE_B
))
{
if
((
vlc
=
svq3_get_ue_golomb
(
&
h
->
gb
))
>=
48
)
{
if
((
vlc
=
svq3_get_ue_golomb
(
&
h
->
gb
))
>=
48
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"cbp_vlc=%
d
\n
"
,
vlc
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"cbp_vlc=%
"
PRIu32
"
\n
"
,
vlc
);
return
-
1
;
return
-
1
;
}
}
...
@@ -805,7 +808,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
...
@@ -805,7 +808,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
}
}
if
((
slice_id
=
svq3_get_ue_golomb
(
&
h
->
gb
))
>=
3
)
{
if
((
slice_id
=
svq3_get_ue_golomb
(
&
h
->
gb
))
>=
3
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal slice type %
d
\n
"
,
slice_id
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal slice type %
u
\n
"
,
slice_id
);
return
-
1
;
return
-
1
;
}
}
...
@@ -988,7 +991,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
...
@@ -988,7 +991,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
return
-
1
;
return
-
1
;
buf
=
av_malloc
(
buf_len
);
buf
=
av_malloc
(
buf_len
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"watermark size: %
dx%d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"watermark size: %
ux%u
\n
"
,
watermark_width
,
watermark_height
);
watermark_width
,
watermark_height
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"u1: %x u2: %x u3: %x compressed data size: %d offset: %d
\n
"
,
"u1: %x u2: %x u3: %x compressed data size: %d offset: %d
\n
"
,
...
@@ -1003,7 +1006,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
...
@@ -1003,7 +1006,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
s
->
watermark_key
=
ff_svq1_packet_checksum
(
buf
,
buf_len
,
0
);
s
->
watermark_key
=
ff_svq1_packet_checksum
(
buf
,
buf_len
,
0
);
s
->
watermark_key
=
s
->
watermark_key
<<
16
|
s
->
watermark_key
;
s
->
watermark_key
=
s
->
watermark_key
<<
16
|
s
->
watermark_key
;
av_log
(
avctx
,
AV_LOG_DEBUG
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"watermark key %#
x
\n
"
,
s
->
watermark_key
);
"watermark key %#
"
PRIx32
"
\n
"
,
s
->
watermark_key
);
av_free
(
buf
);
av_free
(
buf
);
#else
#else
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
...
libavcodec/truemotion2.c
View file @
cc8163e1
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
* Duck TrueMotion2 decoder.
* Duck TrueMotion2 decoder.
*/
*/
#include <inttypes.h>
#include "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
#include "get_bits.h"
#include "get_bits.h"
...
@@ -231,7 +233,8 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
...
@@ -231,7 +233,8 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
case
TM2_NEW_HEADER_MAGIC
:
case
TM2_NEW_HEADER_MAGIC
:
return
0
;
return
0
;
default:
default:
av_log
(
ctx
->
avctx
,
AV_LOG_ERROR
,
"Not a TM2 header: 0x%08X
\n
"
,
magic
);
av_log
(
ctx
->
avctx
,
AV_LOG_ERROR
,
"Not a TM2 header: 0x%08"
PRIX32
"
\n
"
,
magic
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
}
}
...
...
libavcodec/tscc2.c
View file @
cc8163e1
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
* TechSmith Screen Codec 2 decoder
* TechSmith Screen Codec 2 decoder
*/
*/
#include <inttypes.h>
#define BITSTREAM_READER_LE
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
...
@@ -226,7 +228,8 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -226,7 +228,8 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
bytestream2_init
(
&
gb
,
buf
,
buf_size
);
bytestream2_init
(
&
gb
,
buf
,
buf_size
);
frame_type
=
bytestream2_get_byte
(
&
gb
);
frame_type
=
bytestream2_get_byte
(
&
gb
);
if
(
frame_type
>
1
)
{
if
(
frame_type
>
1
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Incorrect frame type %d
\n
"
,
frame_type
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Incorrect frame type %"
PRIu32
"
\n
"
,
frame_type
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -309,7 +312,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -309,7 +312,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
}
}
}
}
if
(
bytestream2_get_bytes_left
(
&
gb
)
<
size
)
{
if
(
bytestream2_get_bytes_left
(
&
gb
)
<
size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid slice size (%
d/%d
)
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid slice size (%
"
PRIu32
"/%u
)
\n
"
,
size
,
bytestream2_get_bytes_left
(
&
gb
));
size
,
bytestream2_get_bytes_left
(
&
gb
));
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
...
libavcodec/utvideodec.c
View file @
cc8163e1
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
* Ut Video decoder
* Ut Video decoder
*/
*/
#include <inttypes.h>
#include <stdlib.h>
#include <stdlib.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
...
@@ -371,7 +372,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -371,7 +372,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
c
->
frame_info
=
bytestream2_get_le32u
(
&
gb
);
c
->
frame_info
=
bytestream2_get_le32u
(
&
gb
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"frame information flags %X
\n
"
,
c
->
frame_info
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"frame information flags %"
PRIX32
"
\n
"
,
c
->
frame_info
);
c
->
frame_pred
=
(
c
->
frame_info
>>
8
)
&
3
;
c
->
frame_pred
=
(
c
->
frame_info
>>
8
)
&
3
;
...
@@ -492,7 +494,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -492,7 +494,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if
(
c
->
frame_info_size
!=
4
)
if
(
c
->
frame_info_size
!=
4
)
avpriv_request_sample
(
avctx
,
"Frame info not 4 bytes"
);
avpriv_request_sample
(
avctx
,
"Frame info not 4 bytes"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Encoding parameters %08
X
\n
"
,
c
->
flags
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Encoding parameters %08
"
PRIX32
"
\n
"
,
c
->
flags
);
c
->
slices
=
(
c
->
flags
>>
24
)
+
1
;
c
->
slices
=
(
c
->
flags
>>
24
)
+
1
;
c
->
compression
=
c
->
flags
&
1
;
c
->
compression
=
c
->
flags
&
1
;
c
->
interlaced
=
c
->
flags
&
0x800
;
c
->
interlaced
=
c
->
flags
&
0x800
;
...
...
libavcodec/wmalosslessdec.c
View file @
cc8163e1
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,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"
...
@@ -192,7 +194,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -192,7 +194,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avpriv_report_missing_feature
(
avctx
,
"Bit-depth higher than 16"
);
avpriv_report_missing_feature
(
avctx
,
"Bit-depth higher than 16"
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
else
{
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown bit-depth: %
d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown bit-depth: %
"
PRIu8
"
\n
"
,
s
->
bits_per_sample
);
s
->
bits_per_sample
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -234,7 +236,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -234,7 +236,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
s
->
bV3RTM
=
s
->
decode_flags
&
0x100
;
s
->
bV3RTM
=
s
->
decode_flags
&
0x100
;
if
(
s
->
max_num_subframes
>
MAX_SUBFRAMES
)
{
if
(
s
->
max_num_subframes
>
MAX_SUBFRAMES
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid number of subframes %
i
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid number of subframes %
"
PRIu8
"
\n
"
,
s
->
max_num_subframes
);
s
->
max_num_subframes
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -252,7 +254,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -252,7 +254,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
}
if
(
s
->
num_channels
<
0
)
{
if
(
s
->
num_channels
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid number of channels %
d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid number of channels %
"
PRId8
"
\n
"
,
s
->
num_channels
);
s
->
num_channels
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
else
if
(
s
->
num_channels
>
WMALL_MAX_CHANNELS
)
{
}
else
if
(
s
->
num_channels
>
WMALL_MAX_CHANNELS
)
{
...
@@ -377,7 +379,7 @@ static int decode_tilehdr(WmallDecodeCtx *s)
...
@@ -377,7 +379,7 @@ static int decode_tilehdr(WmallDecodeCtx *s)
++
chan
->
num_subframes
;
++
chan
->
num_subframes
;
if
(
num_samples
[
c
]
>
s
->
samples_per_frame
)
{
if
(
num_samples
[
c
]
>
s
->
samples_per_frame
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"broken frame: "
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"broken frame: "
"channel len(%
d) > samples_per_frame(%d
)
\n
"
,
"channel len(%
"
PRIu16
") > samples_per_frame(%"
PRIu16
"
)
\n
"
,
num_samples
[
c
],
s
->
samples_per_frame
);
num_samples
[
c
],
s
->
samples_per_frame
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -1087,7 +1089,8 @@ static int decode_frame(WmallDecodeCtx *s)
...
@@ -1087,7 +1089,8 @@ static int decode_frame(WmallDecodeCtx *s)
if
(
len
!=
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
+
2
)
{
if
(
len
!=
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
+
2
)
{
/* FIXME: not sure if this is always an error */
/* FIXME: not sure if this is always an error */
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"frame[%i] would have to skip %i bits
\n
"
,
s
->
frame_num
,
"frame[%"
PRIu32
"] would have to skip %i bits
\n
"
,
s
->
frame_num
,
len
-
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
-
1
);
len
-
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
-
1
);
s
->
packet_loss
=
1
;
s
->
packet_loss
=
1
;
return
0
;
return
0
;
...
@@ -1202,7 +1205,8 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
...
@@ -1202,7 +1205,8 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
if
(
!
s
->
packet_loss
&&
if
(
!
s
->
packet_loss
&&
((
s
->
packet_sequence_number
+
1
)
&
0xF
)
!=
packet_sequence_number
)
{
((
s
->
packet_sequence_number
+
1
)
&
0xF
)
!=
packet_sequence_number
)
{
s
->
packet_loss
=
1
;
s
->
packet_loss
=
1
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet loss detected! seq %x vs %x
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet loss detected! seq %"
PRIx8
" vs %x
\n
"
,
s
->
packet_sequence_number
,
packet_sequence_number
);
s
->
packet_sequence_number
,
packet_sequence_number
);
}
}
s
->
packet_sequence_number
=
packet_sequence_number
;
s
->
packet_sequence_number
=
packet_sequence_number
;
...
...
libavcodec/wmaprodec.c
View file @
cc8163e1
...
@@ -86,6 +86,8 @@
...
@@ -86,6 +86,8 @@
* subframe in order to reconstruct the output samples.
* subframe in order to reconstruct the output samples.
*/
*/
#include <inttypes.h>
#include "libavutil/float_dsp.h"
#include "libavutil/float_dsp.h"
#include "libavutil/intfloat.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
...
@@ -332,13 +334,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -332,13 +334,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
s
->
dynamic_range_compression
=
(
s
->
decode_flags
&
0x80
);
s
->
dynamic_range_compression
=
(
s
->
decode_flags
&
0x80
);
if
(
s
->
max_num_subframes
>
MAX_SUBFRAMES
)
{
if
(
s
->
max_num_subframes
>
MAX_SUBFRAMES
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid number of subframes %
i
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid number of subframes %
"
PRId8
"
\n
"
,
s
->
max_num_subframes
);
s
->
max_num_subframes
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
s
->
min_samples_per_subframe
<
WMAPRO_BLOCK_MIN_SIZE
)
{
if
(
s
->
min_samples_per_subframe
<
WMAPRO_BLOCK_MIN_SIZE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid minimum block size %
i
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid minimum block size %
"
PRId8
"
\n
"
,
s
->
max_num_subframes
);
s
->
max_num_subframes
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -1408,7 +1410,8 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
...
@@ -1408,7 +1410,8 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
if
(
len
!=
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
+
2
)
{
if
(
len
!=
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
+
2
)
{
/** FIXME: not sure if this is always an error */
/** FIXME: not sure if this is always an error */
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"frame[%i] would have to skip %i bits
\n
"
,
s
->
frame_num
,
"frame[%"
PRIu32
"] would have to skip %i bits
\n
"
,
s
->
frame_num
,
len
-
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
-
1
);
len
-
(
get_bits_count
(
gb
)
-
s
->
frame_offset
)
-
1
);
s
->
packet_loss
=
1
;
s
->
packet_loss
=
1
;
return
0
;
return
0
;
...
@@ -1546,7 +1549,8 @@ static int decode_packet(AVCodecContext *avctx, void *data,
...
@@ -1546,7 +1549,8 @@ static int decode_packet(AVCodecContext *avctx, void *data,
if
(
!
s
->
packet_loss
&&
if
(
!
s
->
packet_loss
&&
((
s
->
packet_sequence_number
+
1
)
&
0xF
)
!=
packet_sequence_number
)
{
((
s
->
packet_sequence_number
+
1
)
&
0xF
)
!=
packet_sequence_number
)
{
s
->
packet_loss
=
1
;
s
->
packet_loss
=
1
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet loss detected! seq %x vs %x
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet loss detected! seq %"
PRIx8
" vs %x
\n
"
,
s
->
packet_sequence_number
,
packet_sequence_number
);
s
->
packet_sequence_number
,
packet_sequence_number
);
}
}
s
->
packet_sequence_number
=
packet_sequence_number
;
s
->
packet_sequence_number
=
packet_sequence_number
;
...
...
libavcodec/xwddec.c
View file @
cc8163e1
...
@@ -20,6 +20,8 @@
...
@@ -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/imgutils.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
...
@@ -75,9 +77,11 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -75,9 +77,11 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
ncolors
=
bytestream2_get_be32u
(
&
gb
);
ncolors
=
bytestream2_get_be32u
(
&
gb
);
bytestream2_skipu
(
&
gb
,
header_size
-
(
XWD_HEADER_SIZE
-
20
));
bytestream2_skipu
(
&
gb
,
header_size
-
(
XWD_HEADER_SIZE
-
20
));
av_log
(
avctx
,
AV_LOG_DEBUG
,
"pixformat %d, pixdepth %d, bunit %d, bitorder %d, bpad %d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"pixformat %"
PRIu32
", pixdepth %"
PRIu32
", bunit %"
PRIu32
", bitorder %"
PRIu32
", bpad %"
PRIu32
"
\n
"
,
pixformat
,
pixdepth
,
bunit
,
bitorder
,
bpad
);
pixformat
,
pixdepth
,
bunit
,
bitorder
,
bpad
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"vclass %d, ncolors %d, bpp %d, be %d, lsize %d, xoffset %d
\n
"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"vclass %"
PRIu32
", ncolors %"
PRIu32
", bpp %"
PRIu32
", be %"
PRIu32
", lsize %"
PRIu32
", xoffset %"
PRIu32
"
\n
"
,
vclass
,
ncolors
,
bpp
,
be
,
lsize
,
xoffset
);
vclass
,
ncolors
,
bpp
,
be
,
lsize
,
xoffset
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"red %0x, green %0x, blue %0x
\n
"
,
rgb
[
0
],
rgb
[
1
],
rgb
[
2
]);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"red %0x, green %0x, blue %0x
\n
"
,
rgb
[
0
],
rgb
[
1
],
rgb
[
2
]);
...
@@ -92,7 +96,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -92,7 +96,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
}
}
if
(
xoffset
)
{
if
(
xoffset
)
{
avpriv_request_sample
(
avctx
,
"xoffset %
d
"
,
xoffset
);
avpriv_request_sample
(
avctx
,
"xoffset %
"
PRIu32
"
"
,
xoffset
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
...
@@ -141,7 +145,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -141,7 +145,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
}
}
if
(
pixformat
!=
XWD_Z_PIXMAP
)
{
if
(
pixformat
!=
XWD_Z_PIXMAP
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"pixmap format %
d
unsupported
\n
"
,
pixformat
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"pixmap format %
"
PRIu32
"
unsupported
\n
"
,
pixformat
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
...
@@ -193,7 +197,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -193,7 +197,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_NONE
)
{
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_NONE
)
{
avpriv_request_sample
(
avctx
,
avpriv_request_sample
(
avctx
,
"Unknown file: bpp %
d, pixdepth %d, vclass %d
"
,
"Unknown file: bpp %
"
PRIu32
", pixdepth %"
PRIu32
", vclass %"
PRIu32
"
"
,
bpp
,
pixdepth
,
vclass
);
bpp
,
pixdepth
,
vclass
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
...
...
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