diff --git a/ffmpeg.c b/ffmpeg.c index faeb2f5c3a..2d979c9160 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1172,8 +1172,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter, AVFilterContext *first_filter = in->filter_ctx; AVFilter *filter = avfilter_get_by_name("buffer"); InputStream *ist = ifilter->ist; - AVRational tb = ist->framerate.num ? (AVRational){ist->framerate.den, - ist->framerate.num} : + AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) : ist->st->time_base; AVRational fr = ist->framerate.num ? ist->framerate : ist->st->r_frame_rate; diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 6ef2db2299..791e66af7b 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -62,7 +62,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *const p = &s->picture; uint8_t *ptr; - int magic_num, offset, endian; + unsigned int offset; + int magic_num, endian; int x, y; int w, h, stride, bits_per_color, descriptor, elements, target_packet_size, source_packet_size; diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm index da045f71e2..edd603b793 100644 --- a/libavcodec/x86/h264_idct.asm +++ b/libavcodec/x86/h264_idct.asm @@ -704,7 +704,7 @@ h264_idct_dc_add8_mmx2: ALIGN 16 INIT_XMM ; r0 = uint8_t *dst (clobbered), r2 = int16_t *block, r3 = int stride -x264_add8x4_idct_sse2: +h264_add8x4_idct_sse2: movq m0, [r2+ 0] movq m1, [r2+ 8] movq m2, [r2+16] @@ -733,7 +733,7 @@ x264_add8x4_idct_sse2: %else add r0, r0m %endif - call x264_add8x4_idct_sse2 + call h264_add8x4_idct_sse2 .cycle%1end %if %1 < 7 add r2, 64 @@ -768,7 +768,7 @@ cglobal h264_idct_add16_8_sse2, 5, 5 + ARCH_X86_64, 8 %else add r0, r0m %endif - call x264_add8x4_idct_sse2 + call h264_add8x4_idct_sse2 jmp .cycle%1end .try%1dc movsx r0, word [r2 ] @@ -815,7 +815,7 @@ cglobal h264_idct_add16intra_8_sse2, 5, 7 + ARCH_X86_64, 8 mov r0, [r0] add r0, dword [r1+(%1&1)*8+64*(1+(%1>>1))] %endif - call x264_add8x4_idct_sse2 + call h264_add8x4_idct_sse2 jmp .cycle%1end .try%1dc movsx r0, word [r2 ] diff --git a/libavfilter/audio.c b/libavfilter/audio.c index f3eebbfdae..1a201e608b 100644 --- a/libavfilter/audio.c +++ b/libavfilter/audio.c @@ -178,6 +178,10 @@ int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref) buf_out = ff_default_get_audio_buffer(link, dst->min_perms, samplesref->audio->nb_samples); + if (!buf_out) { + avfilter_unref_buffer(samplesref); + return AVERROR(ENOMEM); + } buf_out->pts = samplesref->pts; buf_out->audio->sample_rate = samplesref->audio->sample_rate; diff --git a/libavutil/rational.h b/libavutil/rational.h index 8c2bdb5529..417e29e577 100644 --- a/libavutil/rational.h +++ b/libavutil/rational.h @@ -114,6 +114,17 @@ AVRational av_add_q(AVRational b, AVRational c) av_const; */ AVRational av_sub_q(AVRational b, AVRational c) av_const; +/** + * Invert a rational. + * @param q value + * @return 1 / q + */ +static av_always_inline AVRational av_inv_q(AVRational q) +{ + AVRational r = { q.den, q.num }; + return r; +} + /** * Convert a double precision floating point number to a rational. * inf is expressed as {1,0} or {-1,0} depending on the sign.