db-move: moved webkit2gtk from [testing] to [extra] (x86_64)
[arch-packages.git] / djvulibre / trunk / djvulibre-djvuport-stack-overflow.patch
blobe7bc643ee6d61319114d4392ae1513e0d726cbff
1 diff --git a/libdjvu/DjVuPort.cpp b/libdjvu/DjVuPort.cpp
2 index 2b3e0d2..ede7f6b 100644
3 --- a/libdjvu/DjVuPort.cpp
4 +++ b/libdjvu/DjVuPort.cpp
5 @@ -507,10 +507,19 @@ GP<DjVuFile>
6 DjVuPortcaster::id_to_file(const DjVuPort * source, const GUTF8String &id)
8 GPList<DjVuPort> list;
10 + if (!!opening_id && opening_id == id)
11 + G_THROW("DjVuPortcaster: recursive opening of the same file (corrupted file?)");
12 + else
13 + opening_id = id;
15 compute_closure(source, list, true);
16 GP<DjVuFile> file;
17 for(GPosition pos=list;pos;++pos)
18 if ((file=list[pos]->id_to_file(source, id))) break;
20 + opening_id = GUTF8String();
22 return file;
25 diff --git a/libdjvu/DjVuPort.h b/libdjvu/DjVuPort.h
26 index e2b3125..313dc2b 100644
27 --- a/libdjvu/DjVuPort.h
28 +++ b/libdjvu/DjVuPort.h
29 @@ -484,6 +484,7 @@ private:
30 const DjVuPort *dst, int distance);
31 void compute_closure(const DjVuPort *src, GPList<DjVuPort> &list,
32 bool sorted=false);
33 + GUTF8String opening_id;