Commit 78e39aa7 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Avoid a possible overflow when reading Nikon avi files.
  Add h263dsp dependency to mpeg1video and mpeg2video encoders.
  Fix compilation with --disable-hwaccel=mpeg1_xvmc,mpeg2_xvmc
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents eef74b2e b7702faf
...@@ -1962,9 +1962,9 @@ mpc8_decoder_select="dsputil mpegaudiodsp" ...@@ -1962,9 +1962,9 @@ mpc8_decoder_select="dsputil mpegaudiodsp"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
mpeg_xvmc_decoder_select="mpeg2video_decoder" mpeg_xvmc_decoder_select="mpeg2video_decoder"
mpeg1video_decoder_select="error_resilience mpegvideo" mpeg1video_decoder_select="error_resilience mpegvideo"
mpeg1video_encoder_select="aandcttables mpegvideoenc" mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
mpeg2video_decoder_select="error_resilience mpegvideo" 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_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_encoder_select="h263_encoder" mpeg4_encoder_select="h263_encoder"
msmpeg4v1_decoder_select="h263_decoder" msmpeg4v1_decoder_select="h263_decoder"
......
...@@ -770,7 +770,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) ...@@ -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 */ memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */
s->mb_intra = 1; s->mb_intra = 1;
// if 1, we memcpy blocks in xvmcvideo // 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 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]) ...@@ -986,7 +986,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
} }
//if 1, we memcpy blocks in xvmcvideo //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); ff_xvmc_pack_pblocks(s, cbp);
} }
...@@ -1700,7 +1700,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, ...@@ -1700,7 +1700,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
for (;;) { for (;;) {
// If 1, we memcpy blocks in xvmcvideo. // 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 ff_xvmc_init_block(s); // set s->block
if (mpeg_decode_mb(s, s->block) < 0) if (mpeg_decode_mb(s, s->block) < 0)
......
...@@ -350,8 +350,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end) ...@@ -350,8 +350,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
uint16_t size = avio_rl16(s->pb); uint16_t size = avio_rl16(s->pb);
const char *name = NULL; const char *name = NULL;
char buffer[64] = { 0 }; char buffer[64] = { 0 };
if (avio_tell(s->pb) + size > tag_end) size = FFMIN(size, tag_end - avio_tell(s->pb));
size = tag_end - avio_tell(s->pb);
size -= avio_read(s->pb, buffer, size -= avio_read(s->pb, buffer,
FFMIN(size, sizeof(buffer) - 1)); FFMIN(size, sizeof(buffer) - 1));
switch (tag) { switch (tag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment