summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-12-17 15:56:57 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-12-17 15:57:57 +0100
commit9b4611ccae8df20b70644be82efbeab026374a6b (patch)
tree09a716e8064649c2641e8615a828ea463b89ef67
parentd8dacd50bfc8f7b94793089b3c38dac2ae52174d (diff)
downloadgstreamer-plugins-bad-9b4611ccae8df20b70644be82efbeab026374a6b.tar.gz
openjpegdec: Don't crash when decoding returns NULL data for any component
https://bugzilla.gnome.org/show_bug.cgi?id=758943
-rw-r--r--ext/openjpeg/gstopenjpegdec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/openjpeg/gstopenjpegdec.c b/ext/openjpeg/gstopenjpegdec.c
index 53dc5f6a2..112b3abab 100644
--- a/ext/openjpeg/gstopenjpegdec.c
+++ b/ext/openjpeg/gstopenjpegdec.c
@@ -1050,6 +1050,15 @@ gst_openjpeg_dec_handle_frame (GstVideoDecoder * decoder,
goto decode_error;
#endif
+ {
+ gint i;
+
+ for (i = 0; i < image->numcomps; i++) {
+ if (image->comps[i].data == NULL)
+ goto decode_error;
+ }
+ }
+
gst_buffer_unmap (frame->input_buffer, &map);
ret = gst_openjpeg_dec_negotiate (self, image);