mupdf-1.10a-heap-overflow.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. X-Git-Url: http://git.ghostscript.com/?p=mupdf.git;a=blobdiff_plain;f=source%2Ffitz%2Fpixmap.c;h=f1291dc29d49ead44c10785fd014a0d995e45a91;hp=a8317127da7af6d39eb86fe3ca02cb4106a9b262;hb=2c4e5867ee699b1081527bc6c6ea0e99a35a5c27;hpb=90fa6203ad032fe161d85a3e580941ce3d1216f0
  2. diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
  3. index a831712..f1291dc 100644
  4. --- a/source/fitz/pixmap.c
  5. +++ b/source/fitz/pixmap.c
  6. @@ -1104,6 +1104,7 @@ fz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor,
  7. "@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\n"
  8. "ldr r4, [r13,#4*22] @ r4 = divXY \n"
  9. "ldr r5, [r13,#4*11] @ for (nn = n; nn > 0; n--) { \n"
  10. + "ldr r8, [r13,#4*17] @ r8 = back4 \n"
  11. "18: @ \n"
  12. "mov r14,#0 @ r14= v = 0 \n"
  13. "sub r5, r5, r1, LSL #8 @ for (xx = x; xx > 0; x--) { \n"
  14. @@ -1120,7 +1121,7 @@ fz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor,
  15. "mul r14,r4, r14 @ r14= v *= divX \n"
  16. "mov r14,r14,LSR #16 @ r14= v >>= 16 \n"
  17. "strb r14,[r9], #1 @ *d++ = r14 \n"
  18. - "sub r0, r0, r8 @ s -= back2 \n"
  19. + "sub r0, r0, r8 @ s -= back4 \n"
  20. "subs r5, r5, #1 @ n-- \n"
  21. "bgt 18b @ } \n"
  22. "21: @ \n"
  23. @@ -1249,6 +1250,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)
  24. x += f;
  25. if (x > 0)
  26. {
  27. + int back4 = x * n - 1;
  28. div = x * y;
  29. for (nn = n; nn > 0; nn--)
  30. {
  31. @@ -1263,7 +1265,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)
  32. s -= back5;
  33. }
  34. *d++ = v / div;
  35. - s -= back2;
  36. + s -= back4;
  37. }
  38. }
  39. }