[FFmpeg-devel] [PATCH] avformat/bit: return early from write_packet if pkt->size is 0

Michael Niedermayer michaelni at gmx.at
Thu Feb 26 23:27:15 CET 2015


On Thu, Feb 26, 2015 at 10:11:37PM +0100, Andreas Cadhalpun wrote:
> On 26.02.2015 20:48, Nicolas George wrote:
> >L'octidi 8 ventôse, an CCXXIII, Andreas Cadhalpun a écrit :
> >>the bit format muxer currently segfaults, when it is passed a packet of size 0.
> >>This can be triggered e.g. with:
> >>ffmpeg -y -f lavfi -i sine=duration=0.1 -c:a flac -f bit /dev/null
> >>
> >>Attached patch fixes this.
> >
> >This looks wrong. The "bit" muxer seems to assume packets have a constant
> >size, apparently 10 octets. Someone knowing the format should check, but I
> >suppose this would be more correct:
> >
> >         if (pkt->size != 10)
> >             return AVERROR(EINVAL);
> 
> You're right. New patch with this check attached.
> 
> >Also, it seems you should not be able to mux FLAC into this format, the
> >write header callback does not validate enough. It looks like this muxer is
> >a quick-and-dirty implementation, emphasis on the dirty.
> 
> Indeed. I also attached a patch limiting the bit muxer to codec g729
> with 1 channel, as this is apparently the only thing it supports.

applied both patches

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150226/dbbd8d4a/attachment.asc>


More information about the ffmpeg-devel mailing list