History

Merge commit '802713c4e7b41bc2deed754d78649945c3442063'

* commit '802713c4e7b41bc2deed754d78649945c3442063': mss2: prevent potential uninitialized reads mss2: reindent after last commit mss2: fix handling of unmasked implicit WMV9 rectangles configure: add lavu dependency to lavr/lavfi .pc files x86inc: Set program_name outside of x86inc.asm Conflicts: configure

Michael Niedermayer committed 14 years ago

Commit da501ea2 parents 3a04c18 802713c4 files · +46 −42Browse files

Unified · Split

4 files
  1. configure +2 −2
  2. libavcodec/mss2.c +42 −39
  3. libavutil/x86/x86inc.asm +1 −1
  4. libavutil/x86/x86util.asm +1 −0
configure+2−2
@@ -4417,7 +4417,7 @@ Cflags: -I\${includedir} · 4416 unmodified lines
44174417 EOF
44184418 }
44194419
4420−libavfilter_pc_deps=""
4420+libavfilter_pc_deps="libavutil = $LIBAVUTIL_VERSION"
44214421 enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
44224422 enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
44234423 enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
@@ -4434,7 +4434,7 @@ pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_V · 10 unmodified lines
44344434 pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
44354435 pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
44364436 pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
4437−pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
4437+pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
44384438 pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
44394439 pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
44404440
libavcodec/mss2.c+42−39
@@ -474,7 +474,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 473 unmodified lines
474474 int keyframe, has_wmv9, has_mv, is_rle, is_555, ret;
475475
476476 Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
477− int used_rects = 0, i, implicit_rect, av_uninit(wmv9_mask);
477+ int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
478478
479479 av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
480480 ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
@@ -650,25 +650,6 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 169 unmodified lines
650650 return AVERROR_INVALIDDATA;
651651
652652 buf_size -= bytestream2_tell(&gB);
653− } else if (is_rle) {
654− init_get_bits(&gb, buf, buf_size * 8);
655− if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
656− c->rgb_pic, c->rgb_stride, c->pal, keyframe,
657− ctx->split_position, 0,
658− avctx->width, avctx->height))
659− return ret;
660− align_get_bits(&gb);
661−
662− if (c->slice_split)
663− if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
664− c->rgb_pic, c->rgb_stride, c->pal, keyframe,
665− ctx->split_position, 1,
666− avctx->width, avctx->height))
667− return ret;
668−
669− align_get_bits(&gb);
670− buf += get_bits_count(&gb) >> 3;
671− buf_size -= get_bits_count(&gb) >> 3;
672653 } else {
673654 if (keyframe) {
674655 c->corrupted = 0;
@@ -676,32 +657,54 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 1 unmodified line
676657 if (c->slice_split)
677658 ff_mss12_slicecontext_reset(&ctx->sc[1]);
678659 }
679− else if (c->corrupted)
680− return AVERROR_INVALIDDATA;
681− bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
682− arith2_init(&acoder, &gB);
683− c->keyframe = keyframe;
684− if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0,
685− avctx->width,
686− ctx->split_position))
687− return AVERROR_INVALIDDATA;
660+ if (is_rle) {
661+ init_get_bits(&gb, buf, buf_size * 8);
662+ if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
663+ c->rgb_pic, c->rgb_stride, c->pal, keyframe,
664+ ctx->split_position, 0,
665+ avctx->width, avctx->height))
666+ return ret;
667+ align_get_bits(&gb);
688668
689− buf += arith2_get_consumed_bytes(&acoder);
690− buf_size -= arith2_get_consumed_bytes(&acoder);
691− if (c->slice_split) {
692− if (buf_size < 1)
669+ if (c->slice_split)
670+ if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
671+ c->rgb_pic, c->rgb_stride, c->pal, keyframe,
672+ ctx->split_position, 1,
673+ avctx->width, avctx->height))
674+ return ret;
675+
676+ align_get_bits(&gb);
677+ buf += get_bits_count(&gb) >> 3;
678+ buf_size -= get_bits_count(&gb) >> 3;
679+ } else if (!implicit_rect || wmv9_mask != -1) {
680+ if (c->corrupted)
693681 return AVERROR_INVALIDDATA;
694682 bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
695683 arith2_init(&acoder, &gB);
696− if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0,
697− ctx->split_position,
684+ c->keyframe = keyframe;
685+ if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0,
698686 avctx->width,
699− avctx->height - ctx->split_position))
687+ ctx->split_position))
700688 return AVERROR_INVALIDDATA;
701689
702690 buf += arith2_get_consumed_bytes(&acoder);
703691 buf_size -= arith2_get_consumed_bytes(&acoder);
704− }
692+ if (c->slice_split) {
693+ if (buf_size < 1)
694+ return AVERROR_INVALIDDATA;
695+ bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
696+ arith2_init(&acoder, &gB);
697+ if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0,
698+ ctx->split_position,
699+ avctx->width,
700+ avctx->height - ctx->split_position))
701+ return AVERROR_INVALIDDATA;
702+
703+ buf += arith2_get_consumed_bytes(&acoder);
704+ buf_size -= arith2_get_consumed_bytes(&acoder);
705+ }
706+ } else
707+ memset(c->pal_pic, 0, c->pal_stride * avctx->height);
705708 }
706709
707710 if (has_wmv9) {
@@ -836,8 +839,8 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx) · 128 unmodified lines
836839 if (ret = ff_mss12_decode_init(c, 1, &ctx->sc[0], &ctx->sc[1]))
837840 return ret;
838841 c->pal_stride = c->mask_stride;
839− c->pal_pic = av_malloc(c->pal_stride * avctx->height);
840− c->last_pal_pic = av_malloc(c->pal_stride * avctx->height);
842+ c->pal_pic = av_mallocz(c->pal_stride * avctx->height);
843+ c->last_pal_pic = av_mallocz(c->pal_stride * avctx->height);
841844 if (!c->pal_pic || !c->last_pal_pic) {
842845 mss2_decode_end(avctx);
843846 return AVERROR(ENOMEM);
libavutil/x86/x86inc.asm+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 ; to x264-devel@videolan.org .
3636
3737 %ifndef program_name
38− %define program_name ff
38+ %define program_name x264
3939 %endif
4040
4141 %define WIN64 0
libavutil/x86/x86util.asm+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2424 ;******************************************************************************
2525
26+%define program_name ff
2627 %define cpuflags_mmxext cpuflags_mmx2
2728
2829 %include "libavutil/x86/x86inc.asm"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t