mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-17 04:17:05 +00:00
avfilter/lavfutils: fix memleak of avpacket
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
eedfee12c6
commit
aeddc6e3a5
@ -33,6 +33,8 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
|
|||||||
int frame_decoded, ret = 0;
|
int frame_decoded, ret = 0;
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
|
|
||||||
|
av_init_packet(&pkt);
|
||||||
|
|
||||||
av_register_all();
|
av_register_all();
|
||||||
|
|
||||||
iformat = av_find_input_format("image2");
|
iformat = av_find_input_format("image2");
|
||||||
@ -85,6 +87,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
|
|||||||
av_image_copy(data, linesize, (const uint8_t **)frame->data, frame->linesize, *pix_fmt, *w, *h);
|
av_image_copy(data, linesize, (const uint8_t **)frame->data, frame->linesize, *pix_fmt, *w, *h);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
av_free_packet(&pkt);
|
||||||
avcodec_close(codec_ctx);
|
avcodec_close(codec_ctx);
|
||||||
avformat_close_input(&format_ctx);
|
avformat_close_input(&format_ctx);
|
||||||
av_freep(&frame);
|
av_freep(&frame);
|
||||||
|
Loading…
Reference in New Issue
Block a user