[FFmpeg-devel] [PATCH] swscale-test: use libavcore to get linesize

Michael Niedermayer michaelni
Tue Aug 3 18:08:58 CEST 2010


On Mon, Aug 02, 2010 at 08:18:25PM -0300, Ramiro Polla wrote:
> Hi,
> 
> On Sat, Jul 31, 2010 at 8:21 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sat, Jul 31, 2010 at 07:27:58PM -0300, Ramiro Polla wrote:
> >> $subj
> >
> >> ?Makefile ? ? ? | ? ?1 +
> >> ?swscale-test.c | ? 19 +++----------------
> >> ?2 files changed, 4 insertions(+), 16 deletions(-)
> >> d1c7322c3efe7f24e55c2e920de59a0ef1639d4d ?swscale-test_stride.diff
> >
> > should be ok
> 
> This patch would allocate zero-sized blocks for strides that were
> zero. This lead to a problem in planarCopyWrapper() which tests
> dst[plane] to see if data should be copied for that plane.
> 
> I have attached two new patches. The first patch makes
> planarCopyWrapper() check for both dst[plane] and dstStride[plane],
> and the second patch does the same the previous patch did but only
> allocates when stride != 0.

its better to not allocate 0 sized things, its also implementation defined
if malloc(0)  returns NULL IIRC


> 
> With patch2, patch1 shouldn't be necessary, but it makes swscale more
> robust for bogus input (allocated planes but no stride).

we could maybe check at a central place that data!= NULL && stride == 0
doesnt happen and fail if it is ?

otherwise commit whats needed

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100803/f78a0a45/attachment.pgp>



More information about the ffmpeg-devel mailing list