diff mbox

[FFmpeg-devel] avformat/flvdec: don't propagate empty extradata

Message ID 20180824025028.4404-1-jamrial@gmail.com
State Accepted
Commit 701aca55fd1186e440a5b208374d4754c9181f80
Headers show

Commit Message

James Almer Aug. 24, 2018, 2:50 a.m. UTC
Fixes ticket #7379

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/flvdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Paul B Mahol Aug. 24, 2018, 7:27 a.m. UTC | #1
On 8/24/18, James Almer <jamrial@gmail.com> wrote:
> Fixes ticket #7379
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/flvdec.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>

Probably OK.
James Almer Aug. 24, 2018, 4:23 p.m. UTC | #2
On 8/24/2018 4:27 AM, Paul B Mahol wrote:
> On 8/24/18, James Almer <jamrial@gmail.com> wrote:
>> Fixes ticket #7379
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavformat/flvdec.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
> 
> Probably OK.

Pushed. thanks.
diff mbox

Patch

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 93c7f85237..a2dea464e3 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -753,6 +753,9 @@  static int flv_read_close(AVFormatContext *s)
 
 static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
 {
+    if (!size)
+        return 0;
+
     av_freep(&st->codecpar->extradata);
     if (ff_get_extradata(s, st->codecpar, s->pb, size) < 0)
         return AVERROR(ENOMEM);
@@ -763,6 +766,9 @@  static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
 static int flv_queue_extradata(FLVContext *flv, AVIOContext *pb, int stream,
                                int size)
 {
+    if (!size)
+        return 0;
+
     av_free(flv->new_extradata[stream]);
     flv->new_extradata[stream] = av_mallocz(size +
                                             AV_INPUT_BUFFER_PADDING_SIZE);