aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-07 00:40:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-07 00:40:39 +0100
commit7d75febe0fd3bb65ad5ade9513dcf4d52a522df7 (patch)
tree8e896c5e69ae0d3ca600ee387f8a4ae85257a235 /libavcodec
parent5e6514e24fc3029ac2d1e133fd018a3f3ac2bfdf (diff)
downloadffmpeg-7d75febe0fd3bb65ad5ade9513dcf4d52a522df7.tar.gz
mjpegenc: Fix const correctness and avoid writes into AVFrame of amv_encode_picture()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpegenc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 6f6d775ca8..b8d4d646a5 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -453,10 +453,11 @@ void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64])
// maximum over s->mjpeg_vsample[i]
#define V_MAX 2
static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
- AVFrame *pic, int *got_packet)
+ const AVFrame *pic_arg, int *got_packet)
{
MpegEncContext *s = avctx->priv_data;
+ AVFrame pic = *pic_arg;
int i;
//CODEC_FLAG_EMU_EDGE have to be cleared
@@ -465,10 +466,10 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
//picture should be flipped upside-down
for(i=0; i < 3; i++) {
- pic->data[i] += (pic->linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));
- pic->linesize[i] *= -1;
+ pic.data[i] += (pic.linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));
+ pic.linesize[i] *= -1;
}
- return ff_MPV_encode_picture(avctx, pkt, pic, got_packet);
+ return ff_MPV_encode_picture(avctx, pkt, &pic, got_packet);
}
AVCodec ff_mjpeg_encoder = {