[FFmpeg-devel] [PATCH 3/3] avformat/utils: Set stream side-data size even without side-data

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Fri May 22 04:24:31 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
Was the earlier behaviour actually a bug (I think so) or is this new
behaviour something that should be explicitly documented?

Btw, the stream and packet side-data APIs differ in two more ways:
av_packet_new_side_data() adds padding to the buffer and zeroes it
whereas av_stream_new_side_data() does not. Should this be unified?

 libavformat/utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index e6158d8058..b12aff5eb0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5507,6 +5507,8 @@ uint8_t *av_stream_get_side_data(const AVStream *st,
             return st->side_data[i].data;
         }
     }
+    if (size)
+        *size = 0;
     return NULL;
 }
 
-- 
2.20.1



More information about the ffmpeg-devel mailing list