Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marvin Scholz <epirat07-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] avcodec/vvc: parse all SEI messages
Date: Wed, 11 Jun 2025 20:52:06 +0200
Message-ID: <20250611185206.92984-1-epirat07@gmail.com> (raw)

While the current code iterated over the messages, it always returned
in the first iteration. Instead keep iterating and warn for failure to
parse. At time of writing, none of the parsing functions seems to
actually return an error, ever.

Fix CID 1648348
---
 libavcodec/vvc/sei.c | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/libavcodec/vvc/sei.c b/libavcodec/vvc/sei.c
index d8ab2bf245..cd202edb2a 100644
--- a/libavcodec/vvc/sei.c
+++ b/libavcodec/vvc/sei.c
@@ -184,6 +184,7 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon
         return AVERROR_INVALIDDATA;
 
     for (int i = 0; i < sei->message_list.nb_messages; i++) {
+        int ret = 0;
         SEIRawMessage *message = &sei->message_list.messages[i];
         void *payload          = message->payload;
 
@@ -193,25 +194,32 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon
             c->film_grain_characteristics = av_refstruct_allocz(sizeof(*c->film_grain_characteristics));
             if (!c->film_grain_characteristics)
                 return AVERROR(ENOMEM);
-            return decode_film_grain_characteristics(c->film_grain_characteristics, payload, fc);
+            ret = decode_film_grain_characteristics(c->film_grain_characteristics, payload, fc);
+            break;
 
         case SEI_TYPE_DECODED_PICTURE_HASH:
-            return decode_decoded_picture_hash(&s->picture_hash, payload);
+            ret = decode_decoded_picture_hash(&s->picture_hash, payload);
+            break;
 
         case SEI_TYPE_DISPLAY_ORIENTATION:
-            return decode_display_orientation(&s->common.display_orientation, payload);
+            ret = decode_display_orientation(&s->common.display_orientation, payload);
+            break;
 
         case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO:
-            return decode_content_light_level_info(&s->common.content_light, payload);
+            ret = decode_content_light_level_info(&s->common.content_light, payload);
+            break;
 
         case SEI_TYPE_FRAME_FIELD_INFO:
-            return decode_frame_field_info(&s->frame_field_info, payload);
+            ret = decode_frame_field_info(&s->frame_field_info, payload);
+            break;
 
         case SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT:
-            return decode_ambient_viewing_environment(&s->common.ambient_viewing_environment, payload);
+            ret = decode_ambient_viewing_environment(&s->common.ambient_viewing_environment, payload);
+            break;
 
         case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME:
-            return decode_mastering_display_colour_volume(&s->common.mastering_display, payload);
+            ret = decode_mastering_display_colour_volume(&s->common.mastering_display, payload);
+            break;
 
         default:
             av_log(fc->log_ctx, AV_LOG_DEBUG, "Skipped %s SEI %d\n",
@@ -219,6 +227,13 @@ int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameCon
                     "PREFIX" : "SUFFIX", message->payload_type);
             return FF_H2645_SEI_MESSAGE_UNHANDLED;
         }
+
+        if (ret == AVERROR(ENOMEM))
+            return ret;
+        if (ret < 0)
+            av_log(fc->log_ctx, AV_LOG_WARNING, "Failure to parse %s SEI %d: %s\n",
+                sei->nal_unit_header.nal_unit_type == VVC_PREFIX_SEI_NUT ?
+                    "PREFIX" : "SUFFIX", message->payload_type, av_err2str(ret));
     }
 
     return 0;
-- 
2.39.5 (Apple Git-154)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

             reply	other threads:[~2025-06-11 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 18:52 Marvin Scholz [this message]
2025-06-12 13:23 ` Nuo Mi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250611185206.92984-1-epirat07@gmail.com \
    --to=epirat07-at-gmail.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git