Browse code

avformat/bit: check that pkt->size is 10 in write_packet

Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eeda2c3de8a8484d9e7d1e47ac836bec850b31fc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Andreas Cadhalpun authored on 2015/02/27 05:38:50
Showing 1 changed files
... ...
@@ -133,6 +133,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
133 133
     GetBitContext gb;
134 134
     int i;
135 135
 
136
+    if (pkt->size != 10)
137
+        return AVERROR(EINVAL);
138
+
136 139
     avio_wl16(pb, SYNC_WORD);
137 140
     avio_wl16(pb, 8 * 10);
138 141