[FFmpeg-cvslog] avcodec/h264idct_template: Fix integer overflow in ff_h264_idct_add()
ffmpeg | branch: master | Michael Niedermayer | Tue Aug 1 19:56:07 2017 +0200| [d1bfa80ec464d475a0de3f513bbb62bcd356099a] | committer: Michael Niedermayer avcodec/h264idct_template: Fix integer overflow in ff_h264_idct_add() Fixes: runtime error: signed integer overflow: 26215360 + 2121330944 cannot be represented in type 'int' Fixes: 2809/clusterfuzz-testcase-minimized-4785181833560064 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1bfa80ec464d475a0de3f513bbb62bcd356099a --- libavcodec/h264idct_template.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c index e1ef68756c..288107d5a4 100644 --- a/libavcodec/h264idct_template.c +++ b/libavcodec/h264idct_template.c @@ -40,10 +40,10 @@ void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride) block[0] += 1 << 5; for(i=0; i<4; i++){ -const SUINT z0= block[i + 4*0] + block[i + 4*2]; -const SUINT z1= block[i + 4*0] - block[i + 4*2]; -const SUINT z2= (block[i + 4*1]>>1) - block[i + 4*3]; -const SUINT z3= block[i + 4*1] + (block[i + 4*3]>>1); +const SUINT z0= block[i + 4*0] + (unsigned)block[i + 4*2]; +const SUINT z1= block[i + 4*0] - (unsigned)block[i + 4*2]; +const SUINT z2= (block[i + 4*1]>>1) - (unsigned)block[i + 4*3]; +const SUINT z3= block[i + 4*1] + (unsigned)(block[i + 4*3]>>1); block[i + 4*0]= z0 + z3; block[i + 4*1]= z1 + z2; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/hevc_cabac: Check for ff_init_cabac_decoder() failure in cabac_reinit()
ffmpeg | branch: master | Michael Niedermayer | Wed Aug 2 00:46:49 2017 +0200| [4ff94558f23a5de43aed4ca3429963dd1d995250] | committer: Michael Niedermayer avcodec/hevc_cabac: Check for ff_init_cabac_decoder() failure in cabac_reinit() Fixes: runtime error: left shift of negative value -967831544 Fixes: 2815/clusterfuzz-testcase-minimized-6062914471460864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ff94558f23a5de43aed4ca3429963dd1d995250 --- libavcodec/hevc_cabac.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c index 4c14e77bcd..853fd3f722 100644 --- a/libavcodec/hevc_cabac.c +++ b/libavcodec/hevc_cabac.c @@ -462,9 +462,9 @@ static void load_states(HEVCContext *s) memcpy(s->HEVClc->cabac_state, s->cabac_state, HEVC_CONTEXTS); } -static void cabac_reinit(HEVCLocalContext *lc) +static int cabac_reinit(HEVCLocalContext *lc) { -skip_bytes(&lc->cc, 0); +return skip_bytes(&lc->cc, 0) == NULL ? AVERROR_INVALIDDATA : 0; } static int cabac_init_decoder(HEVCContext *s) @@ -524,25 +524,27 @@ int ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts) } else { if (s->ps.pps->tiles_enabled_flag && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]) { +int ret; if (s->threads_number == 1) -cabac_reinit(s->HEVClc); +ret = cabac_reinit(s->HEVClc); else { -int ret = cabac_init_decoder(s); -if (ret < 0) -return ret; +ret = cabac_init_decoder(s); } +if (ret < 0) +return ret; cabac_init_state(s); } if (s->ps.pps->entropy_coding_sync_enabled_flag) { if (ctb_addr_ts % s->ps.sps->ctb_width == 0) { +int ret; get_cabac_terminate(&s->HEVClc->cc); if (s->threads_number == 1) -cabac_reinit(s->HEVClc); +ret = cabac_reinit(s->HEVClc); else { -int ret = cabac_init_decoder(s); -if (ret < 0) -return ret; +ret = cabac_init_decoder(s); } +if (ret < 0) +return ret; if (s->ps.sps->ctb_width == 1) cabac_init_state(s); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] speedhq: fix behavior of single-field decoding
ffmpeg | branch: master | Steinar H. Gunderson | Thu Aug 3 09:22:57 2017 +0200| [effd2e7291a12760891289540f944d71ff32a1c8] | committer: James Almer speedhq: fix behavior of single-field decoding The height convention for decoding frames with only a single field made sense for compatibility with legacy decoders, but doesn't really match the convention used by NDI, which is the primary (only?) user. Thus, change it to simply assuming that if the two fields overlap, the frame is meant to be a single field and the frame height matches the field height. Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=effd2e7291a12760891289540f944d71ff32a1c8 --- libavcodec/speedhq.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 60efb0222b..47b1e4dc7a 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -450,10 +450,13 @@ static int speedhq_decode_frame(AVCodecContext *avctx, if (second_field_offset == 4) { /* * Overlapping first and second fields is used to signal - * encoding only a single field (the second field then comes - * as a separate, later frame). + * encoding only a single field. In this case, "height" + * is ambiguous; it could mean either the height of the + * frame as a whole, or of the field. The former would make + * more sense for compatibility with legacy decoders, + * but this matches the convention used in NDI, which is + * the primary user of this trick. */ -frame->height >>= 1; if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 0, 4, buf_size, 1)) < 0) return ret; } else { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] speedhq: add FATE tests
ffmpeg | branch: master | Steinar H. Gunderson | Thu Aug 3 09:31:30 2017 +0200| [45ffe4645e682e0cd13a1c5c23de40dc1a00ff7c] | committer: James Almer speedhq: add FATE tests Also add simple FATE tests, based on output produced by the NDI SDK. Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=45ffe4645e682e0cd13a1c5c23de40dc1a00ff7c --- tests/Makefile | 1 + tests/fate/speedhq.mak | 8 tests/ref/fate/speedhq-422 | 6 ++ tests/ref/fate/speedhq-422-singlefield | 6 ++ 4 files changed, 21 insertions(+) diff --git a/tests/Makefile b/tests/Makefile index ab83ae855d..30f05bec15 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -165,6 +165,7 @@ include $(SRC_PATH)/tests/fate/qtrle.mak include $(SRC_PATH)/tests/fate/real.mak include $(SRC_PATH)/tests/fate/screen.mak include $(SRC_PATH)/tests/fate/source.mak +include $(SRC_PATH)/tests/fate/speedhq.mak include $(SRC_PATH)/tests/fate/subtitles.mak include $(SRC_PATH)/tests/fate/utvideo.mak include $(SRC_PATH)/tests/fate/video.mak diff --git a/tests/fate/speedhq.mak b/tests/fate/speedhq.mak new file mode 100644 index 00..32405b710f --- /dev/null +++ b/tests/fate/speedhq.mak @@ -0,0 +1,8 @@ +FATE_SPEEDHQ = fate-speedhq-422 \ + fate-speedhq-422-singlefield + +fate-speedhq-422: CMD = framecrc -flags +bitexact -f rawvideo -c:v speedhq -tag:v SHQ2 -video_size 112x64 -i $(TARGET_SAMPLES)/speedhq/progressive.shq2 -pix_fmt yuv422p +fate-speedhq-422-singlefield: CMD = framecrc -flags +bitexact -f rawvideo -c:v speedhq -tag:v SHQ2 -video_size 112x32 -i $(TARGET_SAMPLES)/speedhq/singlefield.shq2 -pix_fmt yuv422p + +FATE_SAMPLES_FFMPEG-$(call DEMDEC, RAWVIDEO, SPEEDHQ) += $(FATE_SPEEDHQ) +fate-speedhq: $(FATE_SPEEDHQ) diff --git a/tests/ref/fate/speedhq-422 b/tests/ref/fate/speedhq-422 new file mode 100644 index 00..7bb0d2388d --- /dev/null +++ b/tests/ref/fate/speedhq-422 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 112x64 +#sar 0: 0/1 +0, 0, 0,1,14336, 0x9bb6dc6d diff --git a/tests/ref/fate/speedhq-422-singlefield b/tests/ref/fate/speedhq-422-singlefield new file mode 100644 index 00..343c52645c --- /dev/null +++ b/tests/ref/fate/speedhq-422-singlefield @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 112x32 +#sar 0: 0/1 +0, 0, 0,1, 7168, 0x75de4109 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Add myself as speedhq maintainer, per request.
ffmpeg | branch: master | Steinar H. Gunderson | Thu Aug 3 09:31:34 2017 +0200| [e67d6c37ee34515ca2cd79137e7ca6b87b170e28] | committer: James Almer Add myself as speedhq maintainer, per request. Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e67d6c37ee34515ca2cd79137e7ca6b87b170e28 --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ae0e08d121..ce5e1dae08 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -233,6 +233,7 @@ Codecs: smvjpegdec.c Ash Hughes snow* Michael Niedermayer, Loren Merritt sonic.c Alex Beregszaszi + speedhq.c Steinar H. Gunderson srt* Aurelien Jacobs sunrast.c Ivo van Poorten svq3.cMichael Niedermayer @@ -598,6 +599,7 @@ Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A Robert Swain EE7A 56EA 4A81 A7B5 2001 A521 67FA 362D A2FC 3E71 Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F +Steinar H. Gunderson C2E9 004F F028 C18E 4EAD DB83 7F61 7561 7797 8F76 Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863 Tiancheng "Timothy" Gu9456 AFC0 814A 8139 E994 8351 7FE6 B095 B582 B0D4 Tim Nicholson 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/htmlsubtitles: fix format specifier in av_bprintf calls
ffmpeg | branch: master | James Almer | Thu Aug 3 17:51:51 2017 -0300| [cae2f1db107dcaab31f29a717ce6f0f9b339088a] | committer: James Almer avcodec/htmlsubtitles: fix format specifier in av_bprintf calls > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cae2f1db107dcaab31f29a717ce6f0f9b339088a --- libavcodec/htmlsubtitles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c index 1492570a74..fb9f900422 100644 --- a/libavcodec/htmlsubtitles.c +++ b/libavcodec/htmlsubtitles.c @@ -193,7 +193,7 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in) if (!(last_tag->color & 0xff00)) av_bprintf(dst, "{\\c}"); else if (last_tag->color != cur_tag->color) -av_bprintf(dst, "{\\c&H%X&}", last_tag->color & 0xff); +av_bprintf(dst, "{\\c&H%"PRIX32"&}", last_tag->color & 0xff); } if (cur_tag->face[0]) { @@ -218,7 +218,7 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in) color = html_color_parse(log_ctx, param); if (color >= 0) { new_tag->color = 0xff00 | color; -av_bprintf(dst, "{\\c&H%X&}", new_tag->color & 0xff); +av_bprintf(dst, "{\\c&H%"PRIX32"&}", new_tag->color & 0xff); } } else if (!av_strncasecmp(param, "face=", 5)) { param += 5 + (param[5] == '"'); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hwupload_cuda : Add 10/16 bit format support
ffmpeg | branch: master | Yogender Gupta | Tue Jul 18 16:19:02 2017 +0530| [2e8679373ab628a19885645ed5e1271be7797600] | committer: Philip Langdale hwupload_cuda : Add 10/16 bit format support Signed-off-by: Philip Langdale > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e8679373ab628a19885645ed5e1271be7797600 --- libavfilter/version.h | 2 +- libavfilter/vf_hwupload_cuda.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/version.h b/libavfilter/version.h index 01dd1dbb72..04ea8b71f8 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #define LIBAVFILTER_VERSION_MAJOR 6 #define LIBAVFILTER_VERSION_MINOR 96 -#define LIBAVFILTER_VERSION_MICRO 100 +#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_hwupload_cuda.c b/libavfilter/vf_hwupload_cuda.c index ef98233d12..063f0285c3 100644 --- a/libavfilter/vf_hwupload_cuda.c +++ b/libavfilter/vf_hwupload_cuda.c @@ -58,6 +58,7 @@ static int cudaupload_query_formats(AVFilterContext *ctx) static const enum AVPixelFormat input_pix_fmts[] = { AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, +AV_PIX_FMT_P010, AV_PIX_FMT_P016, AV_PIX_FMT_YUV444P16, AV_PIX_FMT_NONE, }; static const enum AVPixelFormat output_pix_fmts[] = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hwcontext_cuda : Support YUV444P16 format
ffmpeg | branch: master | Yogender Gupta | Tue Jul 18 16:53:53 2017 +0530| [3407d8118c7236c94dc0eddabc82041e5c130201] | committer: Philip Langdale hwcontext_cuda : Support YUV444P16 format Signed-off-by: Philip Langdale > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3407d8118c7236c94dc0eddabc82041e5c130201 --- libavutil/hwcontext_cuda.c | 8 +++- libavutil/version.h| 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c index ed595c3e0f..dfb67bc941 100644 --- a/libavutil/hwcontext_cuda.c +++ b/libavutil/hwcontext_cuda.c @@ -37,6 +37,7 @@ static const enum AVPixelFormat supported_formats[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_P010, AV_PIX_FMT_P016, +AV_PIX_FMT_YUV444P16, }; static int cuda_frames_get_constraints(AVHWDeviceContext *ctx, @@ -142,6 +143,9 @@ static int cuda_frames_init(AVHWFramesContext *ctx) case AV_PIX_FMT_P016: size = aligned_width * ctx->height * 3; break; +case AV_PIX_FMT_YUV444P16: +size = aligned_width * ctx->height * 6; +break; default: av_log(ctx, AV_LOG_ERROR, "BUG: Pixel format missing from size calculation."); return AVERROR_BUG; @@ -161,7 +165,8 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame) int width_in_bytes = ctx->width; if (ctx->sw_format == AV_PIX_FMT_P010 || -ctx->sw_format == AV_PIX_FMT_P016) { +ctx->sw_format == AV_PIX_FMT_P016 || +ctx->sw_format == AV_PIX_FMT_YUV444P16) { width_in_bytes *= 2; } aligned_width = FFALIGN(width_in_bytes, CUDA_FRAME_ALIGNMENT); @@ -188,6 +193,7 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame) frame->linesize[2] = aligned_width / 2; break; case AV_PIX_FMT_YUV444P: +case AV_PIX_FMT_YUV444P16: frame->data[0] = frame->buf[0]->data; frame->data[1] = frame->data[0] + aligned_width * ctx->height; frame->data[2] = frame->data[1] + aligned_width * ctx->height; diff --git a/libavutil/version.h b/libavutil/version.h index 35987e7b50..3dad41f74d 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -81,7 +81,7 @@ #define LIBAVUTIL_VERSION_MAJOR 55 #define LIBAVUTIL_VERSION_MINOR 69 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_ssim: fix temp size calculation
ffmpeg | branch: master | Muhammad Faiz | Thu Aug 3 07:59:09 2017 +0700| [f2d23ec03f28c6233059687c65a9124f65f8c312] | committer: Muhammad Faiz avfilter/vf_ssim: fix temp size calculation Also use av_mallocz_array. Fix Ticket6519. Reviewed-by: Tobias Rapp Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2d23ec03f28c6233059687c65a9124f65f8c312 --- libavfilter/vf_ssim.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c index c3c204268f..d8c049177c 100644 --- a/libavfilter/vf_ssim.c +++ b/libavfilter/vf_ssim.c @@ -219,6 +219,8 @@ static float ssim_endn_8bit(const int (*sum0)[4], const int (*sum1)[4], int widt return ssim; } +#define SUM_LEN(w) (((w) >> 2) + 3) + static float ssim_plane_16bit(SSIMDSPContext *dsp, uint8_t *main, int main_stride, uint8_t *ref, int ref_stride, @@ -228,7 +230,7 @@ static float ssim_plane_16bit(SSIMDSPContext *dsp, int z = 0, y; float ssim = 0.0; int64_t (*sum0)[4] = temp; -int64_t (*sum1)[4] = sum0 + (width >> 2) + 3; +int64_t (*sum1)[4] = sum0 + SUM_LEN(width); width >>= 2; height >>= 2; @@ -256,7 +258,7 @@ static float ssim_plane(SSIMDSPContext *dsp, int z = 0, y; float ssim = 0.0; int (*sum0)[4] = temp; -int (*sum1)[4] = sum0 + (width >> 2) + 3; +int (*sum1)[4] = sum0 + SUM_LEN(width); width >>= 2; height >>= 2; @@ -402,7 +404,7 @@ static int config_input_ref(AVFilterLink *inlink) for (i = 0; i < s->nb_components; i++) s->coefs[i] = (double) s->planeheight[i] * s->planewidth[i] / sum; -s->temp = av_malloc_array((2 * inlink->w + 12), sizeof(*s->temp) * (1 + (desc->comp[0].depth > 8))); +s->temp = av_mallocz_array(2 * SUM_LEN(inlink->w), (desc->comp[0].depth > 8) ? sizeof(int64_t[4]) : sizeof(int[4])); if (!s->temp) return AVERROR(ENOMEM); s->max = (1 << desc->comp[0].depth) - 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog