Fix memory leak on error
On decode error, unref the packet.
This commit is contained in:
parent
d061c30965
commit
5c739874a4
1 changed files with 1 additions and 0 deletions
|
@ -115,6 +115,7 @@ static int run_decoder(void *data) {
|
||||||
int len = avcodec_decode_video2(codec_ctx, decoder->frames->decoding_frame, &got_picture, &packet);
|
int len = avcodec_decode_video2(codec_ctx, decoder->frames->decoding_frame, &got_picture, &packet);
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
LOGE("Could not decode video packet: %d", len);
|
LOGE("Could not decode video packet: %d", len);
|
||||||
|
av_packet_unref(&packet);
|
||||||
goto run_quit;
|
goto run_quit;
|
||||||
}
|
}
|
||||||
if (got_picture) {
|
if (got_picture) {
|
||||||
|
|
Loading…
Reference in a new issue