summaryrefslogtreecommitdiff
path: root/ext/theora/gsttheoradec.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2013-03-31 18:28:09 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2013-03-31 18:31:36 +0200
commitf15bc6835b2dee002340f1f67c0233e0bc6305f7 (patch)
tree52fa7bdcfe06eef3f089fe028df82c80a380a705 /ext/theora/gsttheoradec.c
parentda673880eb8f9bca9c84f63ef722720b3a3fc49f (diff)
theoradec: handle empty adapter
Should not be empty but might be when we actually pass and decode the 0 packets later.
Diffstat (limited to 'ext/theora/gsttheoradec.c')
-rw-r--r--ext/theora/gsttheoradec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c
index 3bff25908..ed5d3f42a 100644
--- a/ext/theora/gsttheoradec.c
+++ b/ext/theora/gsttheoradec.c
@@ -273,11 +273,13 @@ theora_dec_parse (GstVideoDecoder * decoder,
av = gst_adapter_available (adapter);
- data = gst_adapter_map (adapter, 1);
- /* check for keyframe; must not be header packet */
- if (!(data[0] & 0x80) && (data[0] & 0x40) == 0)
- GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
- gst_adapter_unmap (adapter);
+ if (av > 0) {
+ data = gst_adapter_map (adapter, 1);
+ /* check for keyframe; must not be header packet */
+ if (!(data[0] & 0x80) && (data[0] & 0x40) == 0)
+ GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
+ gst_adapter_unmap (adapter);
+ }
/* and pass along all */
gst_video_decoder_add_to_frame (decoder, av);