# HG changeset patch # User reimar # Date 1282384970 0 # Node ID 6b45e5fb9dc432be994d1044b00ac6099d52c2ac # Parent c1e009d855b539a49b383f9eed271595c7583bb5 Fix reading of VUK: actually fail if the key is incomplete instead of continuing with uninitialized data. diff -r c1e009d855b5 -r 6b45e5fb9dc4 stream/stream_bd.c --- a/stream/stream_bd.c Sat Aug 21 09:58:02 2010 +0000 +++ b/stream/stream_bd.c Sat Aug 21 10:02:50 2010 +0000 @@ -160,7 +160,6 @@ } id2str(discid, 20, idstr); while (!stream_eof(file)) { - int i; char line[1024]; char *vst; @@ -184,12 +183,12 @@ break; vst += 6; while (isspace(*vst)) vst++; - if (strlen(vst) < 32) + if (sscanf(vst, "%16"SCNx64, &bd->vuk.u64[0]) != 1) continue; - for (i = 0; i < 16; i++) { - if (sscanf(&vst[i*2], "%2"SCNx8, &bd->vuk.u8[i]) != 1) - break; - } + if (sscanf(vst + 16, "%16"SCNx64, &bd->vuk.u64[1]) != 1) + continue; + bd->vuk.u64[0] = av_be2ne64(bd->vuk.u64[0]); + bd->vuk.u64[1] = av_be2ne64(bd->vuk.u64[1]); vukfound = 1; } free_stream(file);