unknow bug when dealing with mp4

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ajax4sec
Posts: 2
Joined: 2016-08-13T02:07:41-07:00
Authentication code: 1151

unknow bug when dealing with mp4

Post by ajax4sec »

I try to open a MP4 file with ImageMagick-7.0.2-8-Q16-x86-dll on Win 7 x86. It seems the application is stuck and the memory arise very high. And I look up the task manager, I think something wrong when calling ffmpeg to process the file. So I try the file on VLC which is also based on ffmpeg and it is processed properly without memory explosion. Although the file does not cause further damage, it makes the application DoS.
So I upload the sample and share it with the address:
https://1drv.ms/v/s!Am_gj6YCV6PhfrhSOPBsWzN8UXU

I hope it is helpful to you!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: unknow bug when dealing with mp4

Post by snibgo »

The MP4 appears to be 8191x8191 pixels per frame, 69 seconds long, 15 frames per second, so this is 69 G pixels. I doubt if you have enough memory, so it will eat your memory then spend all it's time caching pixels to disk. A very long time.

I suggest you extract the frames with ffmeg, then use IM on individual frames, or small batches of frames.
snibgo's IM pages: im.snibgo.com
ajax4sec
Posts: 2
Joined: 2016-08-13T02:07:41-07:00
Authentication code: 1151

Re: unknow bug when dealing with mp4

Post by ajax4sec »

The memory arise to about 1.2G and will fall to 900M, and up and down. It seems ImageMagick tries to cache it with a limited memory. I try to use ffmpeg with the sample and find that ffmpeg will return some error information. Could ImageMagick use this to avoid DoS? Does the process of return information miss something? As ImageMagick serves as libaries, someone can use this to cause DoS and it will become a big problem :lol: .
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: unknow bug when dealing with mp4

Post by fmw42 »

Imagemagick sets limits on memory, etc. See policy.xml. Discussion at ImageMagick Policy Configuration
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: unknow bug when dealing with mp4

Post by snibgo »

To reduce denial-of-service problems, you can set limits in policy.xml.
snibgo's IM pages: im.snibgo.com
Post Reply