]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/g722enc.c
aacdec: avoid an out-of-bounds write
[ffmpeg] / libavcodec / g722enc.c
index e7b67dad4f4f287d4fad89068b600f6d87437901..be437946c6484fdf973925f91fc3f8dc8d573b24 100644 (file)
@@ -106,7 +106,7 @@ static av_cold int g722_encode_init(AVCodecContext * avctx)
            a common packet size for VoIP applications */
         avctx->frame_size = 320;
     }
-    avctx->delay = 22;
+    avctx->initial_padding = 22;
 
     if (avctx->trellis) {
         /* validate trellis */
@@ -375,7 +375,7 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     }
 
     if (frame->pts != AV_NOPTS_VALUE)
-        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
+        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
     *got_packet_ptr = 1;
     return 0;
 }