summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-27 05:34:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-27 05:34:50 +0100
commitf2f8632aa5584438a09983b64c67908a96f029b9 (patch)
tree5e0153473c5ac1fc04bcccdd2136256485ed09c1 /ffmpeg.c
parent80d2dddad1ab74506810fcdf3a08eedadec88477 (diff)
ffmpeg: Check that frames are user type before treating them as such
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 56bd79a35a..5ec0a1ae8e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -573,6 +573,9 @@ static void codec_release_buffer(AVCodecContext *s, AVFrame *frame)
FrameBuffer *buf = frame->opaque;
int i;
+ if(frame->type!=FF_BUFFER_TYPE_USER)
+ return avcodec_default_release_buffer(s, frame);
+
for (i = 0; i < FF_ARRAY_ELEMS(frame->data); i++)
frame->data[i] = NULL;
@@ -2051,7 +2054,7 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
if (!frame_sample_aspect->num)
*frame_sample_aspect = ist->st->sample_aspect_ratio;
decoded_frame->pts = ist->pts;
- if (ist->dr1) {
+ if (ist->dr1 && decoded_frame->type==FF_BUFFER_TYPE_USER) {
FrameBuffer *buf = decoded_frame->opaque;
AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(
decoded_frame->data, decoded_frame->linesize,