summaryrefslogtreecommitdiff
path: root/gst-libs/gst/codecparsers/gstmpegvideoparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/codecparsers/gstmpegvideoparser.c')
-rw-r--r--gst-libs/gst/codecparsers/gstmpegvideoparser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gst-libs/gst/codecparsers/gstmpegvideoparser.c b/gst-libs/gst/codecparsers/gstmpegvideoparser.c
index b45156a8d..ec8c934bb 100644
--- a/gst-libs/gst/codecparsers/gstmpegvideoparser.c
+++ b/gst-libs/gst/codecparsers/gstmpegvideoparser.c
@@ -334,13 +334,13 @@ gst_mpeg_video_parse (const guint8 * data, gsize size, guint offset)
codoffsize->offset = gst_byte_reader_get_pos (&br) + offset;
rsize = gst_byte_reader_get_remaining (&br);
- if (rsize <= 0) {
- g_free (codoffsize);
- break;
+ if (rsize == 0) {
+ /* if there are no more bytes after the start code set the size to -1 */
+ off = -1;
+ } else {
+ off = scan_for_start_codes (&br, 0, rsize);
}
- off = scan_for_start_codes (&br, 0, rsize);
-
codoffsize->size = off;
ret = g_list_prepend (ret, codoffsize);