This avoids freeing a NULL AVBufferRef*. Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> --- libavcodec/mmaldec.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 7486f3c526..0ea07ea787 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -495,21 +495,20 @@ static int ffmmal_add_packet(AVCodecContext *avctx, const AVPacket *avpkt, data = buf->data; } } - if (!buf) { - ret = AVERROR(ENOMEM); - goto done; - } + if (!buf) + return AVERROR(ENOMEM); + if (avpkt) ctx->packets_sent++; } else { data = ""; if (ctx->eos_sent) - goto done; + return 0; if (!ctx->packets_sent) { // Short-cut the flush logic to avoid upsetting MMAL. ctx->eos_sent = 1; ctx->eos_received = 1; - goto done; + return 0; } } -- 2.27.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".