Real pseudo-RTSP: prevent integer underflow
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 26 Jul 2009 15:39:42 +0000 (18:39 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 26 Jul 2009 15:45:14 +0000 (18:45 +0300)
Pointed-out-by: tixxDZ <tixxdz@gmail.com> - DZCORE Labs, Algeria
modules/access/rtsp/real.c

index ccc7e54..fdd8dd1 100644 (file)
@@ -600,6 +600,7 @@ int real_get_rdt_chunk(rtsp_client_t *rtsp_session, rmff_pheader_t *ph,
 
   int n;
   rmff_dump_pheader(ph, (char*)*buffer);
+  if (pf->length<12) return 0;
   n=rtsp_read_data(rtsp_session, (uint8_t*)(*buffer + 12), ph->length - 12);
   return (n <= 0) ? 0 : n+12;
 }