[xiph-commits] r16315 - branches/theora-thusnelda/lib/dec

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Tue Jul 21 22:21:02 PDT 2009


Author: xiphmont
Date: 2009-07-21 22:21:02 -0700 (Tue, 21 Jul 2009)
New Revision: 16315

Modified:
   branches/theora-thusnelda/lib/dec/decode.c
Log:
Fix EOF-related boundary issues in decode telemetry for very very low rates.



Modified: branches/theora-thusnelda/lib/dec/decode.c
===================================================================
--- branches/theora-thusnelda/lib/dec/decode.c	2009-07-22 01:56:26 UTC (rev 16314)
+++ branches/theora-thusnelda/lib/dec/decode.c	2009-07-22 05:21:02 UTC (rev 16315)
@@ -2616,6 +2616,25 @@
         fullw=250*h*fpsd*mult/fpsn;
         padw=w-24;
         /* header and coded block bits */
+        if(_dec->telemetry_frame_bytes<0 ||
+           _dec->telemetry_frame_bytes==OC_LOTS_OF_BITS)
+          _dec->telemetry_frame_bytes=0;
+        if(_dec->telemetry_coding_bytes<0 ||
+           _dec->telemetry_coding_bytes>_dec->telemetry_frame_bytes)
+          _dec->telemetry_coding_bytes=0;
+        if(_dec->telemetry_mode_bytes<0 ||
+           _dec->telemetry_mode_bytes>_dec->telemetry_frame_bytes)
+          _dec->telemetry_mode_bytes=0;
+        if(_dec->telemetry_mv_bytes<0 ||
+           _dec->telemetry_mv_bytes>_dec->telemetry_frame_bytes)
+          _dec->telemetry_mv_bytes=0;
+        if(_dec->telemetry_qi_bytes<0 ||
+           _dec->telemetry_qi_bytes>_dec->telemetry_frame_bytes)
+          _dec->telemetry_qi_bytes=0;
+        if(_dec->telemetry_dc_bytes<0 ||
+           _dec->telemetry_dc_bytes>_dec->telemetry_frame_bytes)
+          _dec->telemetry_dc_bytes=0;
+
         widths[0]=padw*(_dec->telemetry_frame_bytes-_dec->telemetry_coding_bytes)/fullw;
         widths[1]=padw*(_dec->telemetry_coding_bytes-_dec->telemetry_mode_bytes)/fullw;
         widths[2]=padw*(_dec->telemetry_mode_bytes-_dec->telemetry_mv_bytes)/fullw;



More information about the commits mailing list