[FFmpeg-cvslog] ffmpeg: Fix image allocation.
Michael Niedermayer
michaelni at gmx.at
Wed Feb 15 23:23:58 CET 2012
On Wed, Feb 15, 2012 at 10:32:40PM +0100, Reimar Döffinger wrote:
> On 15 Feb 2012, at 21:39, git at videolan.org (Michael Niedermayer) wrote:
> > ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 15 20:31:57 2012 +0100| [60991ad6ae61e131085891c37e8e517b5014ce21] | committer: Michael Niedermayer
> >
> > ffmpeg: Fix image allocation.
> >
> > This probably fixes some of the use of uninitialized issues valgrind shows in fate.
> > It might also fix other issues.
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> >
> >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60991ad6ae61e131085891c37e8e517b5014ce21
> > ---
> >
> > ffmpeg.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index efe579a..8659ff7 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -510,7 +510,7 @@ static int alloc_buffer(AVCodecContext *s, InputStream *ist, FrameBuffer **pbuf)
> > for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
> > const int h_shift = i==0 ? 0 : h_chroma_shift;
> > const int v_shift = i==0 ? 0 : v_chroma_shift;
> > - if (s->flags & CODEC_FLAG_EMU_EDGE)
> > + if ((s->flags & CODEC_FLAG_EMU_EDGE) || !buf->linesize[1])
>
> Could you explain the logic behind using [1] and not [i]?
> As a hack to detect paletted formats it seems not that great/reliable.
i tried to keep it similar to the get_buffer code in utils.c on which
this code was based
improvments are welcome of course
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20120215/d639e101/attachment.asc>
More information about the ffmpeg-cvslog
mailing list