Compare commits

...

10 Commits

Author SHA1 Message Date
Mark Thompson
01e291a592 hwcontext_vaapi: Remove use of vaExportSurfaceHandle()
It is not present in libva 2.0.
2017-10-15 12:45:15 +01:00
Michael Niedermayer
03351cce88 Update versions for 3.4 release
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-15 02:30:15 +02:00
Michael Niedermayer
46abeb1c32 avcodec/snowdec: Check mv_scale
Fixes: runtime error: signed integer overflow: 2 * -1094995530 cannot be represented in type 'int'
Fixes: 3512/clusterfuzz-testcase-minimized-4812747210489856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 393d6fc739)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-15 01:43:23 +02:00
Michael Niedermayer
35e36046f1 avcodec/pafvideo: Check for bitstream end in decode_0()
Fixes: Timeout
Fixes: 3529/clusterfuzz-testcase-5057068371279872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9c85329cd0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-15 01:43:23 +02:00
Sasi Inguva
8500de89ea ffmpeg.c: Fallback to duration_dts, when duration_pts can't be determined.
This is required for FLV files, for which duration_pts comes out to be zero.

Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2b006ccf83)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-15 01:43:23 +02:00
Ivan Kalvachev
a11a18b284 Fix visual glitch with XvMC, caused by wrong idct permutation.
In the past XvMC forced simple_idct since
it was using FF_IDCT_PERM_NONE.
However now we have SIMD variants of simple_idct that
are using FF_IDCT_PERM_TRANSPOSE and if they are selected
XvMC would get coefficients in the wrong order.

The patch creates new FF_IDCT_NONE that
is used only for this kind of hardware decoding
and that fallbacks to the old C only simple idct.

Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9054439bad)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-15 01:43:23 +02:00
James Almer
7deb7e6acd configure: force erroring out in check_disable_warning() if an option doesn't exists
Should prevent some options from being added to cflags when they
don't exist and the compiler only warns about it.

Reviewd-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit ad56e8057d)
2017-10-13 20:57:38 -03:00
Ivan Kalvachev
7fb85ad360 Fix crash if av_vdpau_bind_context() is not used.
The public functions av_alloc_vdpaucontext() and
av_vdpau_alloc_context() are allocating AVVDPAUContext
structure that is supposed to be placed in avctx->hwaccel_context.

However the rest of libavcodec/vdpau.c uses avctx->hwaccel_context
as struct VDPAUHWContext, that is bigger and does contain
AVVDPAUContext as first member.

The usage includes write to the new variables in the bigger stuct,
without checking for block size.

Fix by always allocating the bigger structure.

Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
(cherry picked from commit 3a6ded7cfc)
2017-10-13 00:14:54 +02:00
Marton Balint
c8642473e0 configure: remove libdl dependency from libndi_newtek
We are not using dynamic loading for libndi.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 58143b15ad)
2017-10-11 22:50:51 +02:00
Michael Niedermayer
b1ec41a64f add release notes based on release 3.3
Name suggestion was from Helmut K. C. Tessarek

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 07e7ebf52d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 03:11:33 +02:00
13 changed files with 43 additions and 81 deletions

View File

@@ -1,7 +1,7 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>:
version 3.4:
- deflicker video filter
- doubleweave video filter
- lumakey video filter

View File

@@ -1 +1 @@
3.3.git
3.4

15
RELEASE_NOTES Normal file
View File

@@ -0,0 +1,15 @@
┌───────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 3.4 "Cantor" │
└───────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 3.4 "Cantor", about 6
months after the release of FFmpeg 3.3.
A complete Changelog is available at the root of the project, and the
complete Git history on http://source.ffmpeg.org.
We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
on the mailing-lists.

11
configure vendored
View File

@@ -3089,9 +3089,9 @@ decklink_indev_deps="decklink threads"
decklink_indev_extralibs="-lstdc++"
decklink_outdev_deps="decklink threads"
decklink_outdev_extralibs="-lstdc++"
libndi_newtek_indev_deps="libndi_newtek libdl"
libndi_newtek_indev_deps="libndi_newtek"
libndi_newtek_indev_extralibs="-lndi"
libndi_newtek_outdev_deps="libndi_newtek libdl"
libndi_newtek_outdev_deps="libndi_newtek"
libndi_newtek_outdev_extralibs="-lndi"
dshow_indev_deps="IBaseFilter"
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
@@ -6309,9 +6309,14 @@ fi
check_disable_warning(){
warning_flag=-W${1#-Wno-}
test_cflags $warning_flag && add_cflags $1
test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
}
test_cflags -Werror=unused-command-line-argument &&
append unknown_warning_flags "-Werror=unused-command-line-argument"
test_cflags -Werror=unknown-warning-option &&
append unknown_warning_flags "-Werror=unknown-warning-option"
check_disable_warning -Wno-parentheses
check_disable_warning -Wno-switch
check_disable_warning -Wno-format-zero-length

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 3.4
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -2665,8 +2665,13 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
ist->next_dts = AV_NOPTS_VALUE;
}
if (got_output)
ist->next_pts += av_rescale_q(duration_pts, ist->st->time_base, AV_TIME_BASE_Q);
if (got_output) {
if (duration_pts > 0) {
ist->next_pts += av_rescale_q(duration_pts, ist->st->time_base, AV_TIME_BASE_Q);
} else {
ist->next_pts += duration_dts;
}
}
break;
case AVMEDIA_TYPE_SUBTITLE:
if (repeating)

View File

@@ -3146,6 +3146,7 @@ typedef struct AVCodecContext {
#if FF_API_ARCH_ALPHA
#define FF_IDCT_SIMPLEALPHA 23
#endif
#define FF_IDCT_NONE 24 /* Used by XvMC to extract IDCT coefficients with FF_IDCT_PERM_NONE */
#define FF_IDCT_SIMPLEAUTO 128
/**

View File

@@ -279,6 +279,7 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
c->perm_type = FF_IDCT_PERM_NONE;
#endif /* CONFIG_FAANIDCT */
} else { // accurate/default
/* Be sure FF_IDCT_NONE will select this one, since it uses FF_IDCT_PERM_NONE */
c->idct_put = ff_simple_idct_put_8;
c->idct_add = ff_simple_idct_add_8;
c->idct = ff_simple_idct_8;

View File

@@ -1217,7 +1217,7 @@ static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
#endif
)
if (avctx->idct_algo == FF_IDCT_AUTO)
avctx->idct_algo = FF_IDCT_SIMPLE;
avctx->idct_algo = FF_IDCT_NONE;
if (avctx->hwaccel && avctx->pix_fmt == AV_PIX_FMT_XVMC) {
Mpeg1Context *s1 = avctx->priv_data;

View File

@@ -181,6 +181,8 @@ static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
dend = c->frame[page] + c->frame_size;
offset = (x & 0x7F) * 2;
j = bytestream2_get_le16(&c->gb) + offset;
if (bytestream2_get_bytes_left(&c->gb) < (j - offset) * 16)
return AVERROR_INVALIDDATA;
do {
offset++;
if (dst + 3 * c->width + 4 > dend)
@@ -198,7 +200,8 @@ static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
do {
set_src_position(c, &src, &send);
if ((src + 3 * c->width + 4 > send) ||
(dst + 3 * c->width + 4 > dend))
(dst + 3 * c->width + 4 > dend) ||
bytestream2_get_bytes_left(&c->gb) < 4)
return AVERROR_INVALIDDATA;
copy_block4(dst, src, c->width, c->width, 4);
i++;

View File

@@ -394,9 +394,10 @@ static int decode_header(SnowContext *s){
s->mv_scale += get_symbol(&s->c, s->header_state, 1);
s->qbias += get_symbol(&s->c, s->header_state, 1);
s->block_max_depth+= get_symbol(&s->c, s->header_state, 1);
if(s->block_max_depth > 1 || s->block_max_depth < 0){
if(s->block_max_depth > 1 || s->block_max_depth < 0 || s->mv_scale > 256U){
av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large\n", s->block_max_depth);
s->block_max_depth= 0;
s->mv_scale = 0;
return AVERROR_INVALIDDATA;
}
if (FFABS(s->qbias) > 127) {

View File

@@ -816,7 +816,7 @@ do { \
AVVDPAUContext *av_vdpau_alloc_context(void)
{
return av_mallocz(sizeof(AVVDPAUContext));
return av_mallocz(sizeof(VDPAUHWContext));
}
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,

View File

@@ -1076,80 +1076,11 @@ static void vaapi_unmap_to_drm(AVHWFramesContext *dst_fc,
static int vaapi_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst,
const AVFrame *src, int flags)
{
#if CONFIG_VAAPI_1
AVVAAPIDeviceContext *hwctx = hwfc->device_ctx->hwctx;
VASurfaceID surface_id;
VAStatus vas;
VADRMPRIMESurfaceDescriptor va_desc;
AVDRMFrameDescriptor *drm_desc = NULL;
int err, i, j;
surface_id = (VASurfaceID)(uintptr_t)src->data[3];
vas = vaExportSurfaceHandle(hwctx->display, surface_id,
VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
VA_EXPORT_SURFACE_READ_ONLY |
VA_EXPORT_SURFACE_SEPARATE_LAYERS,
&va_desc);
if (vas != VA_STATUS_SUCCESS) {
if (vas == VA_STATUS_ERROR_UNIMPLEMENTED)
return AVERROR(ENOSYS);
av_log(hwfc, AV_LOG_ERROR, "Failed to export surface %#x: "
"%d (%s).\n", surface_id, vas, vaErrorStr(vas));
return AVERROR(EIO);
}
drm_desc = av_mallocz(sizeof(*drm_desc));
if (!drm_desc) {
err = AVERROR(ENOMEM);
goto fail;
}
// By some bizarre coincidence, these structures are very similar...
drm_desc->nb_objects = va_desc.num_objects;
for (i = 0; i < va_desc.num_objects; i++) {
drm_desc->objects[i].fd = va_desc.objects[i].fd;
drm_desc->objects[i].size = va_desc.objects[i].size;
drm_desc->objects[i].format_modifier =
va_desc.objects[i].drm_format_modifier;
}
drm_desc->nb_layers = va_desc.num_layers;
for (i = 0; i < va_desc.num_layers; i++) {
drm_desc->layers[i].format = va_desc.layers[i].drm_format;
drm_desc->layers[i].nb_planes = va_desc.layers[i].num_planes;
for (j = 0; j < va_desc.layers[i].num_planes; j++) {
drm_desc->layers[i].planes[j].object_index =
va_desc.layers[i].object_index[j];
drm_desc->layers[i].planes[j].offset =
va_desc.layers[i].offset[j];
drm_desc->layers[i].planes[j].pitch =
va_desc.layers[i].pitch[j];
}
}
err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src,
&vaapi_unmap_to_drm, drm_desc);
if (err < 0)
goto fail;
dst->width = src->width;
dst->height = src->height;
dst->data[0] = (uint8_t*)drm_desc;
return 0;
fail:
for (i = 0; i < va_desc.num_objects; i++)
close(va_desc.objects[i].fd);
av_freep(&drm_desc);
return err;
#else
// Older versions without vaExportSurfaceHandle() are not supported -
// in theory this is possible with a combination of vaDeriveImage()
// and vaAcquireBufferHandle(), but it doesn't carry enough metadata
// to actually use the result in a generic way.
return AVERROR(ENOSYS);
#endif
}
#endif