ffmpeg | branch: master | Kacper Michajłow <kaspe...@gmail.com> | Fri Jul 25 
18:50:06 2025 +0200| [bf640b53db385ae779485ddcbd7bc1734f986efb] | committer: 
Niklas Haas

avcodec/hevc/hevcdec: handle rpu_buf allocation failure correctly

Signed-off-by: Kacper Michajłow <kaspe...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf640b53db385ae779485ddcbd7bc1734f986efb
---

 libavcodec/hevc/hevcdec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 21ecf063c5..c2897ee336 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -3747,8 +3747,10 @@ static int decode_nal_units(HEVCContext *s, const 
uint8_t *buf, int length)
         }
 
         s->rpu_buf = av_buffer_alloc(nal->raw_size - 2);
-        if (!s->rpu_buf)
-            return AVERROR(ENOMEM);
+        if (!s->rpu_buf) {
+            ret = AVERROR(ENOMEM);
+            goto fail;
+        }
         memcpy(s->rpu_buf->data, nal->raw_data + 2, nal->raw_size - 2);
 
         ret = ff_dovi_rpu_parse(&s->dovi_ctx, nal->data + 2, nal->size - 2,

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

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

Reply via email to