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
2264c110
Commit
2264c110
authored
May 05, 2011
by
Baptiste Coudurier
Committed by
Michael Niedermayer
May 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SVQ3: do not modify const input buffer
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b0e7a932
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
svq3.c
libavcodec/svq3.c
+19
-3
No files found.
libavcodec/svq3.c
View file @
2264c110
...
@@ -70,6 +70,8 @@ typedef struct {
...
@@ -70,6 +70,8 @@ typedef struct {
int
unknown_flag
;
int
unknown_flag
;
int
next_slice_index
;
int
next_slice_index
;
uint32_t
watermark_key
;
uint32_t
watermark_key
;
uint8_t
*
buf
;
int
buf_size
;
}
SVQ3Context
;
}
SVQ3Context
;
#define FULLPEL_MODE 1
#define FULLPEL_MODE 1
...
@@ -927,12 +929,12 @@ static int svq3_decode_frame(AVCodecContext *avctx,
...
@@ -927,12 +929,12 @@ static int svq3_decode_frame(AVCodecContext *avctx,
void
*
data
,
int
*
data_size
,
void
*
data
,
int
*
data_size
,
AVPacket
*
avpkt
)
AVPacket
*
avpkt
)
{
{
const
uint8_t
*
buf
=
avpkt
->
data
;
SVQ3Context
*
svq3
=
avctx
->
priv_data
;
SVQ3Context
*
svq3
=
avctx
->
priv_data
;
H264Context
*
h
=
&
svq3
->
h
;
H264Context
*
h
=
&
svq3
->
h
;
MpegEncContext
*
s
=
&
h
->
s
;
MpegEncContext
*
s
=
&
h
->
s
;
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
int
m
,
mb_type
,
left
;
int
m
,
mb_type
,
left
;
uint8_t
*
buf
;
/* special case for last picture */
/* special case for last picture */
if
(
buf_size
==
0
)
{
if
(
buf_size
==
0
)
{
...
@@ -944,10 +946,21 @@ static int svq3_decode_frame(AVCodecContext *avctx,
...
@@ -944,10 +946,21 @@ static int svq3_decode_frame(AVCodecContext *avctx,
return
0
;
return
0
;
}
}
init_get_bits
(
&
s
->
gb
,
buf
,
8
*
buf_size
);
s
->
mb_x
=
s
->
mb_y
=
h
->
mb_xy
=
0
;
s
->
mb_x
=
s
->
mb_y
=
h
->
mb_xy
=
0
;
if
(
svq3
->
watermark_key
)
{
svq3
->
buf
=
av_fast_realloc
(
svq3
->
buf
,
&
svq3
->
buf_size
,
buf_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
!
svq3
->
buf
)
return
AVERROR
(
ENOMEM
);
memcpy
(
svq3
->
buf
,
avpkt
->
data
,
buf_size
);
buf
=
svq3
->
buf
;
}
else
{
buf
=
avpkt
->
data
;
}
init_get_bits
(
&
s
->
gb
,
buf
,
8
*
buf_size
);
if
(
svq3_decode_slice_header
(
avctx
))
if
(
svq3_decode_slice_header
(
avctx
))
return
-
1
;
return
-
1
;
...
@@ -1092,6 +1105,9 @@ static int svq3_decode_end(AVCodecContext *avctx)
...
@@ -1092,6 +1105,9 @@ static int svq3_decode_end(AVCodecContext *avctx)
MPV_common_end
(
s
);
MPV_common_end
(
s
);
av_freep
(
&
svq3
->
buf
);
svq3
->
buf_size
=
0
;
return
0
;
return
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