From 4dd0c6ce44320ce9f723882d12fff0ad6e2cb214 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 10 Oct 2021 01:56:32 +0900 Subject: [PATCH] codecparsers: {h264,h265}parser: Fix typo around SEI nalu generator Fix to create correct SEI nalu when the size of payloadType and/or payloadType is larger than 255 (0xff) Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1601 Part-of: --- .../gst-plugins-bad/gst-libs/gst/codecparsers/gsth264parser.c | 4 ++-- .../gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264parser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264parser.c index 31ebb93c08..3d912f6976 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264parser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264parser.c @@ -3142,14 +3142,14 @@ gst_h264_create_sei_memory_internal (guint8 nal_prefix_size, /* write payload type bytes */ while (payload_type_data >= 0xff) { WRITE_UINT8 (&nw, 0xff, 8); - payload_type_data -= -0xff; + payload_type_data -= 0xff; } WRITE_UINT8 (&nw, payload_type_data, 8); /* write payload size bytes */ while (payload_size_data >= 0xff) { WRITE_UINT8 (&nw, 0xff, 8); - payload_size_data -= -0xff; + payload_size_data -= 0xff; } WRITE_UINT8 (&nw, payload_size_data, 8); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c index 99cb232285..11bf6e7be3 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c @@ -3987,14 +3987,14 @@ gst_h265_create_sei_memory_internal (guint8 layer_id, guint8 temporal_id_plus1, /* write payload type bytes */ while (payload_type_data >= 0xff) { WRITE_UINT8 (&nw, 0xff, 8); - payload_type_data -= -0xff; + payload_type_data -= 0xff; } WRITE_UINT8 (&nw, payload_type_data, 8); /* write payload size bytes */ while (payload_size_data >= 0xff) { WRITE_UINT8 (&nw, 0xff, 8); - payload_size_data -= -0xff; + payload_size_data -= 0xff; } WRITE_UINT8 (&nw, payload_size_data, 8);