Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e570f895
Commit
e570f895
authored
Feb 22, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libschroedinger: Check memory allocations
parent
521979e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
libschroedinger.c
libavcodec/libschroedinger.c
+2
-0
libschroedingerdec.c
libavcodec/libschroedingerdec.c
+2
-0
libschroedingerenc.c
libavcodec/libschroedingerenc.c
+4
-0
No files found.
libavcodec/libschroedinger.c
View file @
e570f895
...
@@ -191,6 +191,8 @@ SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
...
@@ -191,6 +191,8 @@ SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
uv_height
=
y_height
>>
(
SCHRO_FRAME_FORMAT_V_SHIFT
(
schro_frame_fmt
));
uv_height
=
y_height
>>
(
SCHRO_FRAME_FORMAT_V_SHIFT
(
schro_frame_fmt
));
p_pic
=
av_mallocz
(
sizeof
(
AVPicture
));
p_pic
=
av_mallocz
(
sizeof
(
AVPicture
));
if
(
!
p_pic
)
return
NULL
;
avpicture_alloc
(
p_pic
,
avctx
->
pix_fmt
,
y_width
,
y_height
);
avpicture_alloc
(
p_pic
,
avctx
->
pix_fmt
,
y_width
,
y_height
);
p_frame
=
schro_frame_new
();
p_frame
=
schro_frame_new
();
...
...
libavcodec/libschroedingerdec.c
View file @
e570f895
...
@@ -271,6 +271,8 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx,
...
@@ -271,6 +271,8 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx,
/* Decoder needs a frame - create one and push it in. */
/* Decoder needs a frame - create one and push it in. */
frame
=
ff_create_schro_frame
(
avctx
,
frame
=
ff_create_schro_frame
(
avctx
,
p_schro_params
->
frame_format
);
p_schro_params
->
frame_format
);
if
(
!
frame
)
return
AVERROR
(
ENOMEM
);
schro_decoder_add_output_picture
(
decoder
,
frame
);
schro_decoder_add_output_picture
(
decoder
,
frame
);
break
;
break
;
...
...
libavcodec/libschroedingerenc.c
View file @
e570f895
...
@@ -283,6 +283,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -283,6 +283,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
else
{
}
else
{
/* Allocate frame data to schro input buffer. */
/* Allocate frame data to schro input buffer. */
SchroFrame
*
in_frame
=
libschroedinger_frame_from_data
(
avctx
,
frame
);
SchroFrame
*
in_frame
=
libschroedinger_frame_from_data
(
avctx
,
frame
);
if
(
!
in_frame
)
return
AVERROR
(
ENOMEM
);
/* Load next frame. */
/* Load next frame. */
schro_encoder_push_frame
(
encoder
,
in_frame
);
schro_encoder_push_frame
(
encoder
,
in_frame
);
}
}
...
@@ -331,6 +333,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -331,6 +333,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* Create output frame. */
/* Create output frame. */
p_frame_output
=
av_mallocz
(
sizeof
(
FFSchroEncodedFrame
));
p_frame_output
=
av_mallocz
(
sizeof
(
FFSchroEncodedFrame
));
if
(
!
p_frame_output
)
return
AVERROR
(
ENOMEM
);
/* Set output data. */
/* Set output data. */
p_frame_output
->
size
=
p_schro_params
->
enc_buf_size
;
p_frame_output
->
size
=
p_schro_params
->
enc_buf_size
;
p_frame_output
->
p_encbuf
=
p_schro_params
->
enc_buf
;
p_frame_output
->
p_encbuf
=
p_schro_params
->
enc_buf
;
...
...
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