[xiph-commits] r16404 - branches/theora-thusnelda/examples
gmaxwell at svn.xiph.org
gmaxwell at svn.xiph.org
Mon Aug 3 12:44:17 PDT 2009
Author: gmaxwell
Date: 2009-08-03 12:44:16 -0700 (Mon, 03 Aug 2009)
New Revision: 16404
Modified:
branches/theora-thusnelda/examples/dump_video.c
Log:
Make dump_video do a little more input sanity checking to make it more useful for fuzz testing.
Modified: branches/theora-thusnelda/examples/dump_video.c
===================================================================
--- branches/theora-thusnelda/examples/dump_video.c 2009-08-03 04:50:27 UTC (rev 16403)
+++ branches/theora-thusnelda/examples/dump_video.c 2009-08-03 19:44:16 UTC (rev 16404)
@@ -286,6 +286,7 @@
int ret=buffer_data(infile,&oy);
if(ret==0)break;
while(ogg_sync_pageout(&oy,&og)>0){
+ int got_packet;
ogg_stream_state test;
/* is this a mandated initial header? If not, stop parsing */
@@ -298,10 +299,10 @@
ogg_stream_init(&test,ogg_page_serialno(&og));
ogg_stream_pagein(&test,&og);
- ogg_stream_packetpeek(&test,&op);
+ got_packet = ogg_stream_packetpeek(&test,&op);
/* identify the codec: try theora */
- if(!theora_p && (theora_processing_headers=
+ if((got_packet==1) && !theora_p && (theora_processing_headers=
th_decode_headerin(&ti,&tc,&ts,&op))>=0){
/* it is theora -- save this stream state */
memcpy(&to,&test,sizeof(test));
More information about the commits
mailing list