Module: libav
Branch: master
Commit: 2014231039deeb6dccbf9f5368deb5f9e89d6cd0

Author:    James Almer <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Wed Sep 13 17:07:19 2017 -0300

extract_extradata: return an error when buffer allocation fails

ret is 0 by default.

Signed-off-by: James Almer <[email protected]>
Signed-off-by: Luca Barbato <[email protected]>

---

 libavcodec/extract_extradata_bsf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index 20840bd..100c60d 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -101,14 +101,17 @@ static int extract_extradata_h2645(AVBSFContext *ctx, 
AVPacket *pkt,
 
         if (s->remove) {
             filtered_buf = av_buffer_alloc(pkt->size + 
AV_INPUT_BUFFER_PADDING_SIZE);
-            if (!filtered_buf)
+            if (!filtered_buf) {
+                ret = AVERROR(ENOMEM);
                 goto fail;
+            }
             filtered_data = filtered_buf->data;
         }
 
         extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
         if (!extradata) {
             av_buffer_unref(&filtered_buf);
+            ret = AVERROR(ENOMEM);
             goto fail;
         }
 

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to