Page 1 of 2

Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Thu Jul 09, 2020 12:56 pm
by ya_vanka
I get Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure.
What do I do:
1. connect to rtsp://127.0.0.1:8554/stream.sdp to play video
2. stop video streaming (I use VLC if it matters) -> Access violation ... at avcodec-58.dll (
Access violation ... at avcodec-58.dll
Access violation ... at avcodec-58.dll
access_violation_error.jpg (252.14 KiB) Viewed 39715 times
)
3. stop RVCamera
4. start RVCamera again (video streaming is still stopped) -> Range check error in MD5Encode procedure (
Range check error in MD5Encode procedure
Range check error in MD5Encode procedure
range_check_error.jpg (214.07 KiB) Viewed 39715 times
)

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Thu Jul 09, 2020 1:04 pm
by ya_vanka
The same issue with Range check error in MD5Encode procedure if I press Search camera button in Media Test demo application.

RVMedia v 7.4

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Thu Jul 09, 2020 4:36 pm
by Sergey Tkachenko
MRVMD5.pas must be compiled without overflow checking.
It is fixed in the newer version of RVMedia by adding {$OVERFLOWCHECKS OFF} below the line {$I MRV_Defs.inc}.

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Mon Jul 20, 2020 8:35 am
by ya_vanka
I have {$OVERFLOWCHECKS OFF} directive after {$I MRV_Defs.inc}, but still get the error.

Could you please check it once again.

If it matters overflow checking is turned on in my project.

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Mon Jul 20, 2020 10:43 am
by ya_vanka
And I still get access violation in TRVMFFMPEG.DeinitDecode function
Access violation in TRVMFFMPEG.DeinitDecode function 2
Access violation in TRVMFFMPEG.DeinitDecode function 2
access_violation_error2.jpg (241.85 KiB) Viewed 39459 times

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Tue Jul 21, 2020 7:58 am
by Sergey Tkachenko
Can you tell me which string causes problem in MD5 function?
Please put a breakpoint on the call of MD5String from (MRVMD5.pas) and, store the value of S parameter somewhere, and if this string causes a range check error, send it to me.

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Tue Jul 21, 2020 8:52 am
by ya_vanka
You can see the string in Call Stack panel on the second screenshot.

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Tue Jul 21, 2020 5:45 pm
by ya_vanka
May be there should be {$RANGECHECKS OFF} as well?

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Tue Jul 21, 2020 8:44 pm
by Sergey Tkachenko
Unfortunately, the call stack does not show the value of the string parameter, it shows
RVMD5.MD5String(???)

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Wed Jul 22, 2020 8:15 am
by ya_vanka
Yes, but if we open the source code of md5() we will see that S is directly passed from md5() to MD5String() and the value of the parameter of md5() is shown in call stack, isn't it?

Code: Select all

function md5(S: String): String;
begin
  {$IFDEF MRVDELPHIXE8}
  Result := System.Hash.THashMD5.GetHashString(S);
  {$ELSE}
  Result := MD5Print(MD5String(S));
  {$ENDIF}
end;

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Wed Jul 22, 2020 12:13 pm
by Sergey Tkachenko
As you can see, sometimes instead of the parameter value Delphi shows ??? in the call stack window, especially if the project is compiled with optimization and without stack frames (see compiler options for the project)

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Wed Jul 22, 2020 12:43 pm
by ya_vanka
Yes, I see. But still we can get info from previous calls.

Is that enough to fix the problem or should I do smth else?

And what would you say about access violation errors?

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Wed Jul 22, 2020 6:39 pm
by Sergey Tkachenko
Sorry, I overlooked the previous call.
Tomorrow I'll upload a new version of TRichView and then switch to RVMedia.
I'll try to review code to find that can go wrong in DeinitDecode. If I will not be able to find it, I'll need your assistance to reproduce this problem.

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Tue Jul 28, 2020 6:54 am
by ya_vanka
Are there any news?

Re: Access violation in TRVMFFMPEG.DeinitDecode function and Range check error in MD5Encode procedure

Posted: Tue Jul 28, 2020 11:56 am
by Sergey Tkachenko
Sorry, completing the new release took more time than I expected.
Now I am switching to RVMedia.

The first result: yes, range checking must be turned off for MRVMD5.pas
Add {$R-} to the beginning of this file.