lmlm4: check packet_size against lower limit too
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 19 Mar 2013 15:30:44 +0000 (16:30 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 19 Mar 2013 15:30:44 +0000 (16:30 +0100)
Fixes CID732224

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/lmlm4.c

index 29ee2a3..c8ea421 100644 (file)
@@ -93,8 +93,8 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) {
         av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n");
         return AVERROR(EIO);
     }
-    if (packet_size > LMLM4_MAX_PACKET_SIZE) {
-        av_log(s, AV_LOG_ERROR, "packet size exceeds maximum\n");
+    if (packet_size > LMLM4_MAX_PACKET_SIZE || packet_size<=8) {
+        av_log(s, AV_LOG_ERROR, "packet size %d is invalid\n", packet_size);
         return AVERROR(EIO);
     }