From c892621577b3ff1d34215b4b41899514658e0926 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 20 Jan 2014 11:20:46 +0100 Subject: [PATCH 1/3] Fix compilation with --disable-hwaccel=mpeg1_xvmc,mpeg2_xvmc --- libavcodec/mpeg12dec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index de6b2b6859..08e6bff56c 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -770,7 +770,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */ s->mb_intra = 1; // if 1, we memcpy blocks in xvmcvideo - if (CONFIG_XVMC && s->pack_pblocks) { + if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks) { ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks } @@ -986,7 +986,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) } //if 1, we memcpy blocks in xvmcvideo - if (CONFIG_XVMC && s->pack_pblocks) { + if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks) { ff_xvmc_pack_pblocks(s, cbp); } @@ -1700,7 +1700,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, for (;;) { // If 1, we memcpy blocks in xvmcvideo. - if (CONFIG_XVMC && s->pack_pblocks) + if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks) ff_xvmc_init_block(s); // set s->block if (mpeg_decode_mb(s, s->block) < 0) From 9b78abae19aa18e8427848f4d4367da3822ed627 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 20 Jan 2014 11:25:55 +0100 Subject: [PATCH 2/3] Add h263dsp dependency to mpeg1video and mpeg2video encoders. Fixes compilation with: configure --disable-everything --enable-encoder=mpeg2video --disable-asm --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7c479b2633..1ef8ed955a 100755 --- a/configure +++ b/configure @@ -1961,9 +1961,9 @@ mpc8_decoder_select="dsputil mpegaudiodsp" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" mpeg_xvmc_decoder_select="mpeg2video_decoder" mpeg1video_decoder_select="error_resilience mpegvideo" -mpeg1video_encoder_select="aandcttables mpegvideoenc" +mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp" mpeg2video_decoder_select="error_resilience mpegvideo" -mpeg2video_encoder_select="aandcttables mpegvideoenc" +mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp" mpeg4_decoder_select="h263_decoder mpeg4video_parser" mpeg4_encoder_select="h263_encoder" msmpeg4v1_decoder_select="h263_decoder" From b7702fafb356b757dcd1b3d1ed4f2f32e4ebe9c1 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 20 Jan 2014 11:40:35 +0100 Subject: [PATCH 3/3] Avoid a possible overflow when reading Nikon avi files. Suggested-by: Reimar --- libavformat/avidec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 57fbcd7a1b..bab62a08c1 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -350,8 +350,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end) uint16_t size = avio_rl16(s->pb); const char *name = NULL; char buffer[64] = { 0 }; - if (avio_tell(s->pb) + size > tag_end) - size = tag_end - avio_tell(s->pb); + size = FFMIN(size, tag_end - avio_tell(s->pb)); size -= avio_read(s->pb, buffer, FFMIN(size, sizeof(buffer) - 1)); switch (tag) {