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
6808759a
Commit
6808759a
authored
Jun 14, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/rawdec: fix various bogus error codes and add some logs
Help debugging.
parent
3cc1a898
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
rawdec.c
libavcodec/rawdec.c
+7
-4
No files found.
libavcodec/rawdec.c
View file @
6808759a
...
@@ -109,7 +109,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
...
@@ -109,7 +109,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
context
->
length
=
avpicture_get_size
(
avctx
->
pix_fmt
,
FFALIGN
(
avctx
->
width
,
16
),
avctx
->
height
);
context
->
length
=
avpicture_get_size
(
avctx
->
pix_fmt
,
FFALIGN
(
avctx
->
width
,
16
),
avctx
->
height
);
context
->
buffer
=
av_malloc
(
context
->
length
);
context
->
buffer
=
av_malloc
(
context
->
length
);
if
(
!
context
->
buffer
)
if
(
!
context
->
buffer
)
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
}
else
{
}
else
{
context
->
length
=
avpicture_get_size
(
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
context
->
length
=
avpicture_get_size
(
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
}
}
...
@@ -139,7 +139,7 @@ static int raw_decode(AVCodecContext *avctx,
...
@@ -139,7 +139,7 @@ static int raw_decode(AVCodecContext *avctx,
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
int
linesize_align
=
4
;
int
linesize_align
=
4
;
RawVideoContext
*
context
=
avctx
->
priv_data
;
RawVideoContext
*
context
=
avctx
->
priv_data
;
int
res
;
int
res
,
len
;
AVFrame
*
frame
=
data
;
AVFrame
*
frame
=
data
;
AVPicture
*
picture
=
data
;
AVPicture
*
picture
=
data
;
...
@@ -188,8 +188,11 @@ static int raw_decode(AVCodecContext *avctx,
...
@@ -188,8 +188,11 @@ static int raw_decode(AVCodecContext *avctx,
avctx
->
codec_tag
==
MKTAG
(
'A'
,
'V'
,
'u'
,
'p'
))
avctx
->
codec_tag
==
MKTAG
(
'A'
,
'V'
,
'u'
,
'p'
))
buf
+=
buf_size
-
context
->
length
;
buf
+=
buf_size
-
context
->
length
;
if
(
buf_size
<
context
->
length
-
(
avctx
->
pix_fmt
==
PIX_FMT_PAL8
?
256
*
4
:
0
))
len
=
context
->
length
-
(
avctx
->
pix_fmt
==
PIX_FMT_PAL8
?
256
*
4
:
0
);
return
-
1
;
if
(
buf_size
<
len
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid buffer size, packet size %d < expected length %d
\n
"
,
buf_size
,
len
);
return
AVERROR
(
EINVAL
);
}
if
((
res
=
avpicture_fill
(
picture
,
buf
,
avctx
->
pix_fmt
,
if
((
res
=
avpicture_fill
(
picture
,
buf
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
))
<
0
)
avctx
->
width
,
avctx
->
height
))
<
0
)
...
...
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