[FFmpeg-cvslog] daud: Don' t write packets that are too large to have their size expressed in the bytestream .

Alex Converse git at videolan.org
Sun Apr 10 03:45:28 CEST 2011


ffmpeg | branch: master | Alex Converse <aconverse at google.com> | Fri Apr  8 14:35:17 2011 -0700| [347b375a80afbb27c887a243097c09370cb95d19] | committer: Alex Converse

daud: Don't write packets that are too large to have their size expressed in the bytestream.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=347b375a80afbb27c887a243097c09370cb95d19
---

 libavformat/daud.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavformat/daud.c b/libavformat/daud.c
index ca9be27..1b3cfcf 100644
--- a/libavformat/daud.c
+++ b/libavformat/daud.c
@@ -57,6 +57,11 @@ static int daud_write_header(struct AVFormatContext *s)
 
 static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 {
+    if (pkt->size > 65535) {
+        av_log(s, AV_LOG_ERROR,
+               "Packet size too large for s302m. (%d > 65535)\n", pkt->size);
+        return -1;
+    }
     avio_wb16(s->pb, pkt->size);
     avio_wb16(s->pb, 0x8010); // unknown
     avio_write(s->pb, pkt->data, pkt->size);



More information about the ffmpeg-cvslog mailing list