[PATCH] Fix interlaced MPEG2 decoder crash (issue2367)
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines: "In the case that a P field picture is used as the second field of a frame in which the first field is an I field picture a series of semantic restrictions apply. These ensure that prediction is only made from the I field picture. These restrictions are; ? There shall be no macroblocks that are coded with macroblock_motion_forward zero and macroblock_intra zero. ? Dual prime prediction shall not be used. ? Field prediction in which motion_vertical_field_select indicates the same parity as the field being predicted shall not be used. ? There shall be no skipped macroblocks." So it looks like first and third restrictions are broken in sample file. Attached patch contains check for this situation. Regards, Anatoly.
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file? or is it a damaged file? how has this file been created exactly? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
Anatoly Nenashev <anatoly.nenashev <at> ovsoft.ru> writes:
ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin
Works fine with mplayer -vc ffmpeg12vdpau and vlc, crashes with mplayer -vc mpeg12 and mplayer -vc ffmpeg12 Carl Eugen
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Anatoly Nenashev <anatoly.nenashev <at> ovsoft.ru> writes:
ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin
Works fine with mplayer -vc ffmpeg12vdpau and vlc, crashes with mplayer -vc mpeg12 and mplayer -vc ffmpeg12
Sorry, it also works with -vc mpeg12 (but -vc mpeg12 -vo vdpau -demuxer mpegts crashes for (m)any transport stream ...). Carl Eugen
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
This does not awnser my question. Is this file valid or is it damaged? Or worded differently, is there a matching player from the manufactor whos hardware generated this file which is then capable of displaying something for this frame? If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato
On 23.12.2010 18:33, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
This does not awnser my question. Is this file valid or is it damaged? Or worded differently, is there a matching player from the manufactor whos hardware generated this file which is then capable of displaying something for this frame?
If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly.
Manufactor gives access to video source through the Web Browser. This file has been grabbed from the stream in local network. I don't think it is damaged but it looks like it doesn't contain some data from the start of connection. Close look into the stream shows that sometimes there is double I-frames available (for both fields). May be this is the place where decoder must start to work. I've made truncated original stream that starts from double I-frames and FFmpeg works fine on it.
On 23.12.2010 18:33, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly.
Yes, first field can be successfully decoded, but second can not. Who will need this half decoded frame?
On Thu, Dec 23, 2010 at 07:41:11PM +0300, Anatoly Nenashev wrote:
On 23.12.2010 18:33, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly.
Yes, first field can be successfully decoded, but second can not. Who will need this half decoded frame?
You are the first person ive seen who asks, who needs part of a video. Well I guess the user who wants to watch it [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato
On 23.12.2010 23:32, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 07:41:11PM +0300, Anatoly Nenashev wrote:
On 23.12.2010 18:33, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
Hi! Full problem description available on https://roundup.ffmpeg.org/issue2367. After some research I've found that sample file(exploit.bin) conflicts with specification in the following lines:
is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly.
Yes, first field can be successfully decoded, but second can not. Who will need this half decoded frame?
You are the first person ive seen who asks, who needs part of a video. Well I guess the user who wants to watch it
Ok. I hope the new version is better. I've spent some time to be sure that encoding of second P-field conflicts with specification. And now I'm sure that this is true. Each slice in second P-field contains following series of bytes: (32 or 0A) 5E 02 02 8B C0. This data can be "translated" that slice contains one MB in the beginning and one in the end which are predicted from the field of the same parity (first collision). Other MB's in the slice are skipped (second collision). Last slice also contains additional 4 bytes at the end. I don't know for what they are intended.
On 24.12.2010 22:04, Anatoly Nenashev wrote:
On 23.12.2010 23:32, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 07:41:11PM +0300, Anatoly Nenashev wrote:
On 23.12.2010 18:33, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
> Hi! > Full problem description available on > https://roundup.ffmpeg.org/issue2367. > After some research I've found that sample file(exploit.bin) > conflicts > with specification in the following lines: > > is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin
It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly.
Yes, first field can be successfully decoded, but second can not. Who will need this half decoded frame? You are the first person ive seen who asks, who needs part of a video. Well I guess the user who wants to watch it
Ok. I hope the new version is better. I've spent some time to be sure that encoding of second P-field conflicts with specification. And now I'm sure that this is true. Each slice in second P-field contains following series of bytes: (32 or 0A) 5E 02 02 8B C0. This data can be "translated" that slice contains one MB in the beginning and one in the end which are predicted from the field of the same parity (first collision). Other MB's in the slice are skipped (second collision). Last slice also contains additional 4 bytes at the end. I don't know for what they are intended.
Sorry, forgot to remove some test lines.
On Fri, Dec 24, 2010 at 10:04:31PM +0300, Anatoly Nenashev wrote:
On 23.12.2010 23:32, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 07:41:11PM +0300, Anatoly Nenashev wrote:
On 23.12.2010 18:33, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 11:19:55AM +0300, Anatoly Nenashev wrote:
On 23.12.2010 03:36, Michael Niedermayer wrote:
On Thu, Dec 23, 2010 at 02:16:21AM +0300, Anatoly Nenashev wrote:
> Hi! > Full problem description available on https://roundup.ffmpeg.org/issue2367. > After some research I've found that sample file(exploit.bin) conflicts > with specification in the following lines: > > > is anything capable of playing this file?
or is it a damaged file?
how has this file been created exactly?
Sample file is truncated version of the original file which has been grabbed from Optelecom Siqura C-60. I've left only two first pictures to minimize the problem. Original sample uploaded to ftp://upload.ffmpeg.org/MPlayer/incoming/interlaced_mpeg2/interlaced_mpeg2.bin It can be successfully decoded by libmpeg2 tools. By the way, libmpeg2 reports errors for exploit.bin and returns no frame but don't crash.
If something can play this file then the patch is 100% wrong if nothing can play this file then the patch is still wrong because you drop the previous I field that has been decoded correctly.
Yes, first field can be successfully decoded, but second can not. Who will need this half decoded frame?
You are the first person ive seen who asks, who needs part of a video. Well I guess the user who wants to watch it
Ok. I hope the new version is better.
Its just adding hacks at random places that will break and slow down things, if by sheer luck this makes this file play is something i cant say without testing. Its certainly unfit for trunk
I've spent some time to be sure that encoding of second P-field conflicts with specification. And now I'm sure that this is true. Each slice in second P-field contains following series of bytes: (32 or 0A) 5E 02 02 8B C0. This data can be "translated" that slice contains one MB in the beginning and one in the end which are predicted from the field of the same parity (first collision). Other MB's in the slice are skipped (second collision).
What does the official binary decoder output for the first frame? You cannot fix this without knowing what is correct _first_. One could guess from looking at the output what is likely correct if this field is used by future P fields but its better to know the correct output first. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway
participants (3)
-
anatoly.nenashev@ovsoft.ru -
cehoyos@ag.or.at -
michaelni@gmx.at