Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marc-André Lureau
gst-plugins-good
Commits
1a2bd6c6
Commit
1a2bd6c6
authored
Feb 19, 2009
by
Tim-Philipp Müller
Browse files
jpegenc: error out instead of crashing if no caps have been set
Don't crash if we receive a buffer without caps. Fixes #572413.
parent
7c566951
Changes
1
Hide whitespace changes
Inline
Side-by-side
ext/jpeg/gstjpegenc.c
View file @
1a2bd6c6
...
...
@@ -427,6 +427,9 @@ gst_jpegenc_chain (GstPad * pad, GstBuffer * buf)
jpegenc
=
GST_JPEGENC
(
GST_OBJECT_PARENT
(
pad
));
if
(
G_UNLIKELY
(
jpegenc
->
width
<=
0
||
jpegenc
->
height
<=
0
))
goto
not_negotiated
;
data
=
GST_BUFFER_DATA
(
buf
);
size
=
GST_BUFFER_SIZE
(
buf
);
...
...
@@ -495,6 +498,14 @@ done:
gst_buffer_unref
(
buf
);
return
ret
;
/* ERRORS */
not_negotiated:
{
GST_WARNING_OBJECT
(
jpegenc
,
"no input format set (no caps on buffer)"
);
ret
=
GST_FLOW_NOT_NEGOTIATED
;
goto
done
;
}
}
static
void
...
...
@@ -572,6 +583,8 @@ gst_jpegenc_change_state (GstElement * element, GstStateChange transition)
filter
->
line
[
0
]
=
NULL
;
filter
->
line
[
1
]
=
NULL
;
filter
->
line
[
2
]
=
NULL
;
filter
->
width
=
-
1
;
filter
->
height
=
-
1
;
break
;
default:
break
;
...
...
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