summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <[email protected]>2015-02-26 21:38:50 +0100
committerMichael Niedermayer <[email protected]>2015-03-12 18:03:50 +0100
commit6739df26a62049ae579fa2a31c2552315eb640da (patch)
tree60b18fe61b4ef8dbee8a3f1b7336490958baec15
parentf92e8cccf5813dd62b7c4a2bea072badc7a250cb (diff)
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 <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit eeda2c3de8a8484d9e7d1e47ac836bec850b31fc) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/bit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c
index 1249ea1aee..f346cf4df0 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -132,6 +132,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
GetBitContext gb;
int i;
+ if (pkt->size != 10)
+ return AVERROR(EINVAL);
+
avio_wl16(pb, SYNC_WORD);
avio_wl16(pb, 8 * 10);