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>
pull/125/head
Andreas Cadhalpun 10 years ago committed by Anton Khirnov
parent 72211a2af0
commit 67142a8c72
  1. 2
      libavcodec/roqvideoenc.c

@ -992,6 +992,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
av_lfg_init(&enc->randctx, 1); av_lfg_init(&enc->randctx, 1);
enc->avctx = avctx;
enc->framesSinceKeyframe = 0; enc->framesSinceKeyframe = 0;
if ((avctx->width & 0xf) || (avctx->height & 0xf)) { if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n"); av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");

Loading…
Cancel
Save