You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
fftools/ffmpeg: Don't presume frame_queue to have been allocated
Fixes segfaults upon allocation failure. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -527,11 +527,13 @@ static void ffmpeg_cleanup(int ret)
|
|||||||
for (j = 0; j < fg->nb_inputs; j++) {
|
for (j = 0; j < fg->nb_inputs; j++) {
|
||||||
InputFilter *ifilter = fg->inputs[j];
|
InputFilter *ifilter = fg->inputs[j];
|
||||||
struct InputStream *ist = ifilter->ist;
|
struct InputStream *ist = ifilter->ist;
|
||||||
AVFrame *frame;
|
|
||||||
|
|
||||||
while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0)
|
if (ifilter->frame_queue) {
|
||||||
av_frame_free(&frame);
|
AVFrame *frame;
|
||||||
av_fifo_freep2(&ifilter->frame_queue);
|
while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0)
|
||||||
|
av_frame_free(&frame);
|
||||||
|
av_fifo_freep2(&ifilter->frame_queue);
|
||||||
|
}
|
||||||
av_freep(&ifilter->displaymatrix);
|
av_freep(&ifilter->displaymatrix);
|
||||||
if (ist->sub2video.sub_queue) {
|
if (ist->sub2video.sub_queue) {
|
||||||
AVSubtitle sub;
|
AVSubtitle sub;
|
||||||
|
Reference in New Issue
Block a user