Commit 74e10b62 authored by Justin Ruggles's avatar Justin Ruggles

avcodec: for audio encoding, reset output packet when it is not valid

parent fa0319b4
......@@ -909,8 +909,11 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
avctx->frame_number++;
}
if (ret < 0 || !*got_packet_ptr)
if (ret < 0 || !*got_packet_ptr) {
av_free_packet(avpkt);
av_init_packet(avpkt);
return ret;
}
/* NOTE: if we add any audio encoders which output non-keyframe packets,
this needs to be moved to the encoders, but for now we can do it
......
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