Bug#901735: mediastreamer2: hardcodes wrong FF_INPUT_BUFFER_PADDING_SIZE value

James Cowgill jcowgill at debian.org
Sun Jun 17 18:17:22 BST 2018


Source: mediastreamer2
Version: 1:2.16.1-2
Severity: normal
Tags: patch

Hi,

mediastreamer2 contains this:
(src/videofilters/nowebcam.c)
> #if __clang__
> #pragma clang diagnostic push
> #pragma clang diagnostic ignored "-Wdeprecated-declarations"
> #endif
> 
> #define FF_INPUT_BUFFER_PADDING_SIZE 32
> 
> #if LIBAVCODEC_VERSION_MAJOR >= 57
> 
> #ifdef _MSC_VER
> #pragma warning(disable : 4996)
[...]
> 		if (statbuf.st_size <= 0) {
> 			close(fd);
> 			ms_error("Cannot load %s", jpgpath);
> 			return NULL;
> 		}
> 		jpgbuf=(uint8_t*)ms_malloc0(statbuf.st_size + FF_INPUT_BUFFER_PADDING_SIZE);
> 		if (jpgbuf == NULL) {
> 			close(fd);
> 			ms_error("Cannot allocate buffer for %s", jpgpath);
> 			return NULL;
> 		}

This is likely to break (ie segfault somewhere) once the FFmpeg 4.0
transition starts because FFmpeg 4.0 has increased the required input
buffer padding to 64 bytes. If mediastreamer2 had used the correct
constant (AV_INPUT_BUFFER_PADDING_SIZE) then it would require no changes.

I think the reason for writing the code this way is to support
non-ffmpeg builds. Based on that, I've attached a patch which I think
will be OK for both Debian and upstream.

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-input-buffer-padding.patch
Type: text/x-patch
Size: 2114 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-voip-maintainers/attachments/20180617/78fb1028/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-voip-maintainers/attachments/20180617/78fb1028/attachment.sig>


More information about the Pkg-voip-maintainers mailing list