From f27386cdc76d8524df71e684a3ec5481940004f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 6 Jul 2012 10:53:43 +0300 Subject: [PATCH 1/2] x86: h264_intrapred: Don't add the 'd' suffix to the SPLATB_REG macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SPLATB_REG macro already adds the 'd' suffix internally. This fixes building on Win64, which has been broken since 878e66902. This worked for unix, where r2 happened to be rdx in this case, which with the first suffix rdxd was mapped to eax, and eaxd is defined back to eax. On win64 however, r2 happened to be R8 in this case, and R8d mapps to R8D just fine, but there's no mapping for R8Dd to anything. Signed-off-by: Martin Storsjö --- libavcodec/x86/h264_intrapred.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm index 5984454824..50a615b054 100644 --- a/libavcodec/x86/h264_intrapred.asm +++ b/libavcodec/x86/h264_intrapred.asm @@ -156,7 +156,7 @@ cglobal pred16x16_dc, 2,7 %if cpuflag(ssse3) pxor m1, m1 %endif - SPLATB_REG m0, r2d, m1 + SPLATB_REG m0, r2, m1 %if mmsize==8 mov r3d, 8 From fdaad6354fbf1925c9bfeadd32950c503c1103ad Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 4 Jul 2012 08:13:43 -0700 Subject: [PATCH 2/2] mxfdec: replace x>>av_log2(sizeof(..)) by x/sizeof(..). Also replace x>>av_log2(sizeof(..)) + 1 by x/sizeof(..). The +1 is probably meant to emulate av_log2_ceil(sizeof(..)) in cases where ".." is not a power of two. --- libavformat/mxfdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index dd102408db..594ba49f34 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -700,7 +700,7 @@ static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *seg return 0; else if (segment->nb_index_entries < 0 || segment->nb_index_entries > - (INT_MAX >> av_log2(sizeof(*segment->stream_offset_entries)))) + (INT_MAX / sizeof(*segment->stream_offset_entries))) return AVERROR(ENOMEM); length = avio_rb32(pb); @@ -1084,7 +1084,7 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta if (index_table->nb_ptses <= 0) return 0; - if (index_table->nb_ptses > INT_MAX >> av_log2(sizeof(AVIndexEntry)) + 1) + if (index_table->nb_ptses > INT_MAX / sizeof(AVIndexEntry)) return AVERROR(ENOMEM); index_table->ptses = av_mallocz(index_table->nb_ptses * @@ -1196,7 +1196,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) } } - if (mxf->nb_index_tables > INT_MAX >> av_log2(sizeof(MXFIndexTable)) + 1 || + if (mxf->nb_index_tables > INT_MAX / sizeof(MXFIndexTable) || !(mxf->index_tables = av_mallocz(mxf->nb_index_tables * sizeof(MXFIndexTable)))) { av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate index tables\n"); @@ -1218,7 +1218,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) MXFIndexTable *t = &mxf->index_tables[j]; if (t->nb_segments > - (INT_MAX >> av_log2(sizeof(MXFIndexTableSegment *))) || + (INT_MAX / sizeof(MXFIndexTableSegment *)) || !(t->segments = av_mallocz(t->nb_segments * sizeof(MXFIndexTableSegment*)))) { av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate IndexTableSegment"