avformat/movenc: Fix memleak of reshuffled packet
Fixes CID1361952 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5db111757c
commit
86d703fd55
@ -4812,7 +4812,7 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (trk->par->format == AV_PIX_FMT_PAL8 && !trk->pal_done) {
|
if (trk->par->format == AV_PIX_FMT_PAL8 && !trk->pal_done) {
|
||||||
ret = ff_get_packet_palette(s, opkt, reshuffle_ret, trk->palette);
|
ret = ff_get_packet_palette(s, opkt, reshuffle_ret, trk->palette);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto fail;
|
||||||
if (ret)
|
if (ret)
|
||||||
trk->pal_done++;
|
trk->pal_done++;
|
||||||
} else if (trk->par->codec_id == AV_CODEC_ID_RAWVIDEO &&
|
} else if (trk->par->codec_id == AV_CODEC_ID_RAWVIDEO &&
|
||||||
@ -4823,7 +4823,9 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
if (reshuffle_ret) {
|
if (reshuffle_ret) {
|
||||||
ret = mov_write_single_packet(s, pkt);
|
ret = mov_write_single_packet(s, pkt);
|
||||||
av_packet_free(&pkt);
|
fail:
|
||||||
|
if (reshuffle_ret)
|
||||||
|
av_packet_free(&pkt);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user