diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-10 20:54:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-10 21:37:40 +0100 |
commit | a150bad4062a29fc11b32117bc1ade38115cd95b (patch) | |
tree | ae7ce4ad77daa68624dfd6f65b67a00eedf9b93f /libavfilter/avcodec.c | |
parent | 304a1ed1e86429eb4e20a48d887546b1072ed4da (diff) | |
download | ffmpeg-a150bad4062a29fc11b32117bc1ade38115cd95b.tar.gz |
lavfi/avcodec: check avfilter_copy_frame_props() return code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r-- | libavfilter/avcodec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c index 2a173b2c91..feaf641ccb 100644 --- a/libavfilter/avcodec.c +++ b/libavfilter/avcodec.c @@ -77,7 +77,10 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame frame->format); if (!picref) return NULL; - avfilter_copy_frame_props(picref, frame); + if (avfilter_copy_frame_props(picref, frame) < 0) { + picref->buf->data[0] = NULL; + avfilter_unref_bufferp(&picref); + } return picref; } @@ -90,7 +93,10 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame av_frame_get_channel_layout(frame)); if (!samplesref) return NULL; - avfilter_copy_frame_props(samplesref, frame); + if (avfilter_copy_frame_props(samplesref, frame) < 0) { + samplesref->buf->data[0] = NULL; + avfilter_unref_bufferp(&samplesref); + } return samplesref; } |