aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-03-09 19:24:09 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-05-19 12:03:48 +0100
commit9f6c36d961d27283808310e3ca1d8390b55fce9b (patch)
treee076f74852855ea659ee9e49c3a1ef762d2ed4ed
parent78a3a4580c5a547af4ae8682c662ea3a4699a599 (diff)
downloadffmpeg-9f6c36d961d27283808310e3ca1d8390b55fce9b.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. CC:libav-stable@libav.org Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/roqvideoenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index af0089fb7f..871371be96 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -959,6 +959,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");