avidemux2 icon indicating copy to clipboard operation
avidemux2 copied to clipboard

[ivtcDupeRemover] return true from ivtcDupeRemover::getNextFrame

Open jirislaby opened this issue 5 years ago • 6 comments

It is declared as returning a bool, but returns nothing. But the callers expect something to be returned: true in case it succeeded.

Double check I got it right...

jirislaby avatar Nov 12 '19 10:11 jirislaby

Could you please explain under which circumstances the added return statement can be ever reached?

eumagga0x2a avatar Nov 14 '19 20:11 eumagga0x2a

@eumagga0x2a compiler warns about the default label. ADM_assert expands to ADM_backTrack, but the latter is not defined with no_return attribute. And it actually can return on some platforms (HAIKU or sun), see: https://github.com/mean00/avidemux2/blob/59c11947d07fead588336a4b75a73fc2681711a0/avidemux_core/ADM_core/src/ADM_crashdump_unix.cpp#L185-L231

jirislaby avatar Nov 15 '19 06:11 jirislaby

Based on the previous comment, it should return false, given there is return true hidden in the END_PROCESS macros used there.

jirislaby avatar Nov 15 '19 08:11 jirislaby

the latter is not defined with no_return attribute

Maybe that is the root issue? Why are these two cases "unsupported"? Unwanted, impossible or ToDo? Shouldn't ADM_backTrack print an error and exit, instead of ignoring and returning?

it actually can return on some platforms (HAIKU or sun)

You may want to add a comment here about that.

mm1044 avatar Nov 15 '19 12:11 mm1044

the latter is not defined with no_return attribute

Maybe that is the root issue? Why are these two cases "unsupported"? Unwanted, impossible or ToDo? Shouldn't ADM_backTrack print an error and exit, instead of ignoring and returning?

IMO, it should always die for consistency (and be declared as noreturn). But this is the first time I looked into the avidemux code so I am not the one to decide this...

it actually can return on some platforms (HAIKU or sun)

You may want to add a comment here about that.

What do you mean by here here?

Anyway, pushing implementation of the above shortly.

jirislaby avatar Nov 17 '19 09:11 jirislaby

What do you mean by here here?

I meant at ivtcDupeRemover::getNextFrame(), but that is superseded by your new/current commit.

mm1044 avatar Nov 18 '19 11:11 mm1044