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 d13de6d6db..b4ae920af2 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c
@@ -1492,8 +1492,7 @@ gst_h264_bit_writer_aud (guint8 primary_pic_type, gboolean start_code,
   gboolean have_space = TRUE;
   GstBitWriter bw;
 
-  g_return_val_if_fail (primary_pic_type >= 0
-      && primary_pic_type <= 7, GST_H264_BIT_WRITER_ERROR);
+  g_return_val_if_fail (primary_pic_type <= 7, GST_H264_BIT_WRITER_ERROR);
   g_return_val_if_fail (data != NULL, GST_H264_BIT_WRITER_ERROR);
   g_return_val_if_fail (size != NULL, GST_H264_BIT_WRITER_ERROR);
   g_return_val_if_fail (*size > 0, GST_H264_BIT_WRITER_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 e87de3b78d..52efe4ab50 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c
@@ -1792,8 +1792,8 @@ gst_h265_bit_writer_slice_hdr (const GstH265SliceHdr * slice,
   g_return_val_if_fail (data != NULL, GST_H265_BIT_WRITER_ERROR);
   g_return_val_if_fail (size != NULL, GST_H265_BIT_WRITER_ERROR);
   g_return_val_if_fail (*size > 0, GST_H265_BIT_WRITER_ERROR);
-  g_return_val_if_fail (nal_type >= GST_H265_NAL_SLICE_TRAIL_N &&
-      nal_type <= GST_H265_NAL_SLICE_CRA_NUT, GST_H265_BIT_WRITER_ERROR);
+  g_return_val_if_fail (nal_type <= GST_H265_NAL_SLICE_CRA_NUT,
+      GST_H265_BIT_WRITER_ERROR);
 
   gst_bit_writer_init_with_data (&bw, data, *size, FALSE);