aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-03-09 19:24:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-29 03:34:22 +0200
commit7b3d8ae32d2909c6e2149ae874b565392fd183b2 (patch)
tree857b3cf8dfa32a6056e5691a42b1b9573065ba1c
parent770094752528841e44789e559560c97bf4fdf316 (diff)
downloadffmpeg-7b3d8ae32d2909c6e2149ae874b565392fd183b2.tar.gz
roqvideoenc: set enc->avctx in roq_encode_init
So far it is only set in roq_encode_frame, but it is used in roq_encode_end to free the coded_frame. This currently segfaults if roq_encode_frame is not called between roq_encode_init and roq_encode_end. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit cf82c426fadf90105e1fb9d5ecd267cc3aa2b288) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/roqvideoenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 1c5970f68b..7fbbb85419 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -966,6 +966,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
av_lfg_init(&enc->randctx, 1);
+ enc->avctx = avctx;
+
enc->framesSinceKeyframe = 0;
if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");