summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/bit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c
index 7b807b9bc1..5d05da0f81 100644
--- a/libavformat/bit.c
+++ b/libavformat/bit.c
@@ -133,6 +133,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);