summaryrefslogtreecommitdiff
path: root/ext/theora/gsttheoradec.c
diff options
context:
space:
mode:
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);