[FFmpeg-cvslog] cbs_h2645: Return error if writing fails

Mark Thompson git at videolan.org
Sat Nov 11 06:07:27 EET 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Mon Aug 14 16:46:32 2017 +0100| [768eb9182e94a94bc2ef46f565a0dac7afef3b57] | committer: Mark Thompson

cbs_h2645: Return error if writing fails

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

 libavcodec/cbs_h2645.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 23556f47f8..4d8ba99b35 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -1244,6 +1244,11 @@ static int cbs_h2645_write_nal_unit(CodedBitstreamContext *ctx,
     // Overflow but we didn't notice.
     av_assert0(put_bits_count(&pbc) <= 8 * priv->write_buffer_size);
 
+    if (err < 0) {
+        // Write failed for some other reason.
+        return err;
+    }
+
     if (put_bits_count(&pbc) % 8)
         unit->data_bit_padding = 8 - put_bits_count(&pbc) % 8;
     else



More information about the ffmpeg-cvslog mailing list