Commit 27c6c925 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by James Almer

avformat/av1: Fix leak of dynamic buffer in case of parsing failure

Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 9cd56bb9
......@@ -26,6 +26,7 @@
#include "libavcodec/put_bits.h"
#include "av1.h"
#include "avio.h"
#include "avio_internal.h"
int ff_av1_filter_obus(AVIOContext *pb, const uint8_t *buf, int size)
{
......@@ -67,8 +68,10 @@ int ff_av1_filter_obus_buf(const uint8_t *buf, uint8_t **out, int *size)
return ret;
ret = ff_av1_filter_obus(pb, buf, *size);
if (ret < 0)
if (ret < 0) {
ffio_free_dyn_buf(&pb);
return ret;
}
av_freep(out);
*size = avio_close_dyn_buf(pb, out);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment