diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c index 5661cce0cd..ca9cec5092 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c @@ -1535,6 +1535,7 @@ gst_h264_bit_writer_aud (guint8 primary_pic_type, gboolean start_code, /* Add trailings. */ WRITE_BITS (&bw, 1, 1); if (!gst_bit_writer_align_bytes (&bw, 0)) { + have_space = FALSE; goto error; } diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c index c91f2dd06f..e80de38f2c 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c @@ -2199,6 +2199,7 @@ gst_h265_bit_writer_aud (guint8 pic_type, gboolean start_code, /* Add trailings. */ WRITE_BITS (&bw, 1, 1); if (!gst_bit_writer_align_bytes (&bw, 0)) { + have_space = FALSE; goto error; }